Hi, I'm really confused as to where my repeated column problem is coming from. I'm just trying to setup a simple class Template which extends Page. I can generate the Java code without error and export the schema, but as soon as I initialize Hibernate I get the following error:
Initial SessionFactory creation failed.org.hibernate.MappingException: Repeated column in mapping for entity: beans.Template column: USER_ID (should be mapped with insert="false" update="false")
This is bothersome because Template is extending Page that has USER_ID mapped with those conditions...
Code:
<hibernate-mapping>
<class name="beans.Page" table="PAGE">
<id name="id" type="long" column="PAGE_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
<discriminator column="PAGE_TYPE" type="string"/>
<property name="created" type="date" not-null="true"/>
...
<many-to-one name="user"
class="beans.User"
column="USER_ID"
not-null="true"
insert="false"
update="false"/>
</class>
<subclass name="beans.Template" extends="beans.Page" discriminator-value="T">
<property name="header_color" type="string"/>
...
</subclass>
</hibernate-mapping>