-->
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: Different "Repeated column" behaviour in class and
PostPosted: Thu Oct 09, 2003 11:38 am 
Newbie

Joined: Thu Oct 09, 2003 11:28 am
Posts: 1
Hello,

I was playing with Hibernate and noticed that multiple mapping of the same column behaves differently in class and component. If I create multiple mappings under class and set insert and update to false (see "CITY MAPPING 1"), everything works fine. But if I do the same thing under component (see "CITY MAPPING 2"), "Repeated column" is reported. Here are my mappings:

Code:
<hibernate-mapping>

    <class name="hibernate.City" table="CITY">
        <id name="ID">
            <generator class="native"/>
        </id>
        <property name="name"/>
    </class>

    <class name="hibernate.Person" table="person">
        <id name="ID">
            <generator class="native"/>
        </id>
        <property name="name"/>
        <property name="street" insert="false" update="false"/>
        <property name="houseNo" column="HOUSE_NO" insert="false" update="false"/>
        <!-- CITY MAPPING 1 -->
        <property name="cityID" column="city_id" insert="false" update="false"/>
        <property name="cityID2" column="city_id" insert="false" update="false"/>
        <many-to-one name="city" column="city_id" insert="false" update="false"/>
        <component name="address">
            <parent name="person"/>
            <property name="street" insert="false"/>
            <property name="houseNo" column="HOUSE_NO"/>
            <!-- CITY MAPPING 2 -->
            <property name="cityID" column="city_id" insert="false" update="false"/>
            <property name="cityID2" column="city_id" insert="false" update="false"/>
            <many-to-one name="city" column="city_id" insert="false" update="false"/>
        </component>
    </class>
</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.