EJB3 inheritance strategy TABLE_PER_CLASS does not work on HSQLDB
-----------------------------------------------------------------
Key: HHH-3642
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3642
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.1
Environment: JBoss 5.0GA, Java 1.6, Hypersonic 1.8.0.8
Reporter: Wolfgang Knauf
Attachments: InheritanceTablePerClass.ear
I use an EJB3 entity bean with inheritance strategy "TABLE_PER_CLASS":
@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class Base implements Serializable
{
...
When loading a list of base classes, all subclass fields are null. The union subclause in
the query does not work on HSQLDB.
Attached is a full EJB sample, runnable on JBoss 4.2/5.0 (project export of Eclipse
3.4/WebTools 3.0 with sources). After deploying, it can be tested by browsing to
http://localhost:8080/InheritanceTablePerClassWeb/
See this output:
...
Loading ALL
Item: Child 1, child field 1: null
Item: Child 2, child field 2: null
Item: Child 3, child field 3: Field of Child3
...
Here, all childs are loaded. The fields of type "Child1" and "Child2"
are null, fields of type "Child3" are filled.
This is probably a duplicate of
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2920
The described workaround to change all NULL expressions to "cast (null as
VARCHAR)" results in a working query, but I see no chance to pre-configure this query
in the entity manager.
I created another bug, because the impact is different (it breaks a feature of EJB3), and
so I consider severity to be higher.
--
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