[hibernate-users] HACK: org.hibernate.MappingException: Repeated column in mapping

Ing. Arturo Frappé Muñoz afrappe at acm.org
Tue Mar 3 15:30:35 EST 2009



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 -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-users/attachments/20090303/dc605d90/attachment.html 


More information about the hibernate-users mailing list