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: column name mismatch
PostPosted: Tue May 11, 2010 5:03 am 
Newbie

Joined: Mon May 25, 2009 6:07 am
Posts: 4
Location: Pune, India
I have Two tables Table A and Table B with a many is to one relation. There are no explicitly defined constraints between the tables.

A.cMake & A.cModel holds the value of B.make and B.model respectively. I'm trying to create a mapping file A.hbm.xml, such that A.getB() returns a Set (or Map?).

<hibernate-mapping>

<id name="isn" type="integer">
<column name="ISN" />
<generator class="assigned"></generator>
</id>

<property name="cMake" type="short" >
<column name="CMAKE" />
</property>

<property name="cModel" type="short" >
<column name="CMODEL" />
</property>

<set name="bSet" fetch="???" table="B">
<key>
<column name="MAKE" />
<column name="MODEL" />
</key>
<one-to-many class="B"></one-to-many>
</set>

</hibernate-mapping>

How will I correlate the properties cMake and cModel to the MAKE and MODEL columns?

Is there any better way to getB()?

I was trying to find some way in which I can do this in .hbm.xml rather than do a saved query.

thanks for any help.


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.