For this mapping to subclassed objects (Links)
Container_class
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
@IndexColumn(base=1, name="item_position")
@JoinColumn(name="cnt_id", nullable=false)
@ForeignKey(name="cnt_inlk_fk")
public List<AbstractLink> getLinks() {
return links;
}
When only one object is created with 3 links, and then DB is queried via Criteria
cList = s.createCriteria(Container.class).list();
the result contains 3 objects, should be one.
Please see attached reprocase
mvn test
should do if repositories are set correctly
Hibernate 3.5.5 ORACLE and HSQL databases
I'm not able to run your test case.
Please do the following:
checkout the trunk version http://anonsvn.jboss.org/repos/hibernate/core/trunk
update a test in testsuite/src/test/java/org/hibernate/test/criteria to reproduce your issue
create a patch using "svn diff" and attach to this issue
Thanks,
Gail
This is actually how queries work atm. The duplicated returns are actually all the same instance and are easily de-duped by using a HashSet