Hi everybody,
I'm using hibernate 2.1.14 in my project and I have several mapping strategies: for some objects I use a table per class hierachy strategy and for some other I use table per subclass.
I have a class named A and a class named B. B extends A using the table per class hierachy.
When I execute a query like this : select a from A as a where a.class=B all B instances are returned and when I do select a from A as a where a.class!=B all A instances that are not B instances are returned.
The problem comes when working with the table per subclass strategy, if I do the same ( select a from A as a where a.class=B ) it returns me all the instances of A that are not instances of B and the same case inverted when I ask for the objects that it's class is different from B.
Has anybody any idea about why is this happening?
Thanks in advance
Dave Garcia
|