Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2.0
-
Component/s: DSL for Business Domain
-
Labels:None
-
Number of attachments :
Description
When trying to use Hibernate's table.per.subclass inheritance strategy, the generated hbm.xml seems to be invalid (missing "key" element)
Mod4j.properties contains is configured to use the following hibernate-mapping.inheritance.strategy:
hibernate-mapping.inheritance.strategy=table.per.subclass
In our situation we have a superclass, with a property "superProperty", and a child class with a property "childProperty". See the test.busmod part:
class SuperEntity [
string superProperty;
]
class ChildEntity inherits SuperEntity [
string childProperty;
]
The ChildEntity.hbm.xml seems to be missing the mandatory
"key" element within the "joined-subclass" element (both Eclipse and the ddl-exporter from Hibernate Tools complain):
<hibernate-mapping default-access="field" package="test.domain">
<joined-subclass extends="SuperEntity" name="ChildEntity">
<property name="childProperty" not-null="true"/>
</joined-subclass>
</hibernate-mapping>
It works, but unfortunately this is not verified by our current set of unit tests. Currently it is not possible to generate code with different values for the hibernate-mapping.inheritance.strategy property in mod4j.properties.