Lords & Ladies, this hack is for Hibernate 3.3.1-GA, and solves an
error like this:
org.hibernate.MappingException: Repeated
column in mapping for entity: org.intresting.MyClass column: HACKME_COLUMN
(should be mapped with insert="false"
update="false")
When you use a discriminator column -
with SingleTable inheritance -,
like this:
<class
name="MyClass" .... >
<composite-id name="id" class="MyClassId">
. . .
<key-property
name="hackmecolumn" type="short">
<column name="HACKME_COLUMN"/>
</key-property>
...
</composite-id>
<discriminator column="HACKME_COLUMN" />
...
<subclass name="VeryIntrestingClass"
discriminator-value="21" />
</class>
The hack is: change the case of <discriminator column> to
lowercase.
<discriminator column="hackme_column"
/>
- y santo remedio -