Hi, I'm currently having the same problem as you and with Hibernate. All my entities in the database have a deleted flag. When loading from the database, I want to filter all deleted entries. The only possibility I've found is to add the filter to each entity (does not work when adding to base class) and to each association. This is very error prone and hard to maintain.
Is there no other way to define the filter on the base class, which is used whenever a specialization is loaded? As well for each entity as well as for the associations? Is Hibernate my problem? Please let me know, if you find a solution! Regards, Steven Lukas Weibel wrote: > > Hi there, > > is there any global Datafilter with OpenJPA available? I want do delete > objects just logical (set a delete flag). For some sessions I want to > display only the active objects, but in other sessions the deleted ones > should also be displayed. Another case would be some security level on > each entity. The user can than only view objects that are in his > security level. Of course the filter should also apply for navigating in > the object model: group.getMembers() should only return objects > according to the current (session) filter. > > Has anyone an idea how to solve this problem? > > Hibernate does have such a mechano. But you have to apply the filter on > each association. > > Regards, > Lukas Weibel > > -- View this message in context: http://n2.nabble.com/Global-%28session-based%29-data-filter-tp2269289p2283482.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
