-
Runtime filters in Hibernate (1 messages)
- Posted by: Max Grigoriev
- Posted on: January 30 2008 14:11 EST
Is it possible to add hibernate filters in runtime ? Using annotations or filters in xbm isn't the way because user wants to create own filters and use them. Developers doesn't know all possible filters and can't add them to class. For example we have Owner and Cat, owner has many cats. And external users want to always use owner.getCats() to see current cats. But some users need to see only black cats, some green eyes and etc. And these filters' lifecycle is during one request.Threaded Messages (1)
- Chapter 17 by Johan Roch on February 04 2008 04:18 EST
-
Chapter 17[ Go to top ]
- Posted by: Johan Roch
- Posted on: February 04 2008 04:18 EST
- in response to Max Grigoriev
See Chapter 17(Filtering data) of the reference documentation. "Hibernate3 adds the ability to pre-define filter criteria and attach those filters at both a class and a collection level...The application can then make the decision at runtime whether given filters should be enabled and what their parameter values should be." session.enableFilter("myFilter").setParameter("myFilterParam", "some-value");