-->
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: Duplicate Column Mapping
PostPosted: Mon Jun 27, 2011 3:24 pm 
Newbie

Joined: Mon Jan 10, 2011 1:50 pm
Posts: 3
I have a mapping issue that makes no sense to me. I have two entities, RoomRes and ReportReservation, that have a one-to-many to a GuestInfo. When I start up my app, the RoomRes loads without a problem. However the ReportReservation mapping fails to load saying:

Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: com.traveltripper.stargazer.common.dto.GuestInfo column: roomResId (should be mapped with insert="false" update="false")

The mappings are identical and in separate .hbm.xml files. This makes no sense to me. The backing guest_info table has foreign keys to the proper keys on RoomRes and ReportRes. I know, I know, we should be using auditing tables. We are headed in that direction. We have a lot of ####ed up code to un#### here where development was moved back onshore to do things right. What I am trying to do seems really straightforward. Is this error a red-herring caused by something else?

For what it is worth, my app context loads when I comment out the ReportReservation->GuestInfo mapping. So that seems to be the point of failure. Any help to get me back on a productive path would be appreciated.


The RoomRes->GuestInfo mapping, (abbreviated), is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="com.traveltripper.stargazer.common.dto.res.RoomRes" table="roomres" lazy="false">
<id name="roomResId" column="roomResId">
<generator class="native"/>
</id>
...
...
...

<bag name="guests" table="guest_info" lazy="false" cascade="all">
<key column="roomResId" not-null="true"/>
<one-to-many class="com.traveltripper.stargazer.common.dto.GuestInfo"/>
</bag>
...
...
</hibernate-mapping>

THE REPORT RES MAPPING IS:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<class name="com.traveltripper.stargazer.common.dto.ReportReservation" table="reportReservation" lazy="false">

<id name="roomResId" column="roomResId"/>
...
...
...
<bag name="guests" table="guest_info" lazy="false" cascade="all">
<key column="roomResId" not-null="true"/>
<one-to-many class="com.traveltripper.stargazer.common.dto.GuestInfo"/>
</bag>
...
...

</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.