Hibernate Filters - III

29 August 2008

This is in continuation to the last post.

The methods on Session are:

enableFilter(String filterName)
getEnabledFilter(String filterName)
disableFilter(String filterName)

Remember that the default behavious is that filters are not enabled for a given session. You have to explcitly enabled them
through use of the Session.enabledFilter() method. It will return an instance of the Filter interface.

Using the simple filter defined above, it would look like:

session.enableFilter("myFilter").setParameter("myFilterParam", "some-value");

The methods on the org.hibernate.Filter interface do allow the method-chaining common to much of Hibernate.

del.icio.us:Hibernate Filters - III  digg:Hibernate Filters - III  spurl:Hibernate Filters - III  wists:Hibernate Filters - III  simpy:Hibernate Filters - III  newsvine:Hibernate Filters - III  blinklist:Hibernate Filters - III  furl:Hibernate Filters - III  reddit:Hibernate Filters - III  fark:Hibernate Filters - III  blogmarks:Hibernate Filters - III  Y!:Hibernate Filters - III  smarking:Hibernate Filters - III  magnolia:Hibernate Filters - III  segnalo:Hibernate Filters - III  gifttagging:Hibernate Filters - III

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Hibernate Filters - III

Leave a Reply