Description

Subclasses should have the ability to use a filter-def to filter data independently from the parent class

In my case I have a joined subclass that I want to filter but I don't want to filter the parent and the other derived classes by the same

Environment

None

Activity

Show:

Alex Zaytsev May 1, 2017 at 3:40 AM

Closing issues resolved in 4.1.0

Alex Zaytsev February 22, 2015 at 1:27 AM

Merged to master @ c888f4da3942f2a0fd368326f77848c414d88baf

Hung Tran Dinh October 17, 2012 at 10:45 AM

yes, I also need this feature. Is there any news?

Hibernate already supports it from v3.0.0 beta 4 (https://hibernate.onjira.com/browse/HHH-123)

Cassio Tavares February 8, 2010 at 12:44 PM

But you can't define a condition specifically for Cat, Dog and even Pet.

All of them have to filter properties that exist in the base class. In this case "Animal".

If Dog has a property bool BarkAtTheMoon how can I filter by it?

I would like to do something like:

<joined-subclass name="Dog" table="dog">

<property column="BarkAtTheMoon" type="Boolean" name="BarkAtTheMoon" not-null="true" />

<filter name="BATM" condition="BarkAtTheMoon = :barkAtTheMoon" />

</joined-subclass>

Thanks

Fabio Maulo February 6, 2010 at 9:04 PM

Not clear.
You are filtering a class where the state is composed from various tables.
If you have Animal, Pets, Dog, Cat
Pet is a Animal
Cat is a Pet
Dog is a Pet.

If you apply a filter for Pet your filter will be applied for any Pet (mean for Dog and Cat)
If you apply a filter for Animal your filter will be applied for any Animal (mean for Pet,Dog and Cat)
If you apply a filter for Dog your filter will be applied only for Dog.

With NH you are querying and filtering with objects and not tables.

Can you explain which is your case ?

Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details

Assignee

Alex Zaytsev

Reporter

Cassio Tavares

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created December 23, 2009 at 2:00 PM
Updated May 1, 2017 at 3:40 AM
Resolved February 22, 2015 at 1:27 AM
Who's Looking?