-->
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: Mapping a Column twice
PostPosted: Mon Jun 15, 2009 8:42 am 
Newbie

Joined: Mon Jun 15, 2009 5:03 am
Posts: 2
Hi!

We are trying to Map a Column (attributeId) one time as a String (just the ID) and one time as an Entity (Attribute) from the Attributes Table.

We realize that this is completely redundant, but unfortunately the people who originally constructed the mapping made a mistake and leaving out the String ID Property would mean a lot of restructuring in our code.

What we need is the attributeId to be saved via the String Property and when the object gets loaded we need access to one of the properties from the Attributes Table (which means we need the entire Attribute Object). The problem we were faced with is that when we map both the String Property and Entity Hibernate tries to insert into the attributeId Column twice (of course, because it is mapped twice).

In effect I'm holding a Foreign Key as a Property and also need to map the Foreign Key to retrieve one of the Properties of the referenced object.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.