[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-613?page=co...
]
Paul Benedict commented on HHH-613:
-----------------------------------
I'd like to know why this is correct behavior. I also am trying to perform
sub-criteria on a polymorphic association. I really am looking for a particular type, and
I have not read anywhere -- at least from what I can find -- why this isn't supported.
Is it a technical limitation? A philosophical limitation? Time constraint?
search by criteria with sub-class Example do not bind sub-class
properties
--------------------------------------------------------------------------
Key: HHH-613
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-613
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.0.5
Reporter: Foaloke
Priority: Blocker
class Animal {
private Int age;
...
}
class Pet extends Animal {
private String name;
...
}
Pet pet = new Pet();
pet.setName("Fritz");
session.createCriteria(Animal.class).add(Example.create(pet)).list();
This will simply return all 'Pets', no binding occurs with the "name"
property of Pet.
This could, more probably, occurs if I have some Country which contains Animals & I
want to look for some kind of Pets in that country :
session.createCriteria(Country.class).createCriteria("animal").add(Example.create(pet)).list();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira