Mod4j: Modeling for Java using Domain Specific Languages

Hibernate mapping is missing the mandatory(?) "key" element

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.2.0
  • Labels:
    None
  • Number of attachments :
    0

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>

Activity

Hide
Eric Jan Malotaux added a comment -

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.

Show
Eric Jan Malotaux added a comment - 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: