-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Repeated column in mapping for entity
PostPosted: Mon Oct 08, 2007 12:47 pm 
Newbie

Joined: Sat Jul 14, 2007 11:50 am
Posts: 12
Location: the Burgh
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>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.