-->
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.  [ 2 posts ] 
Author Message
 Post subject: mapping object property to several tables
PostPosted: Wed Feb 23, 2005 7:30 am 
Newbie

Joined: Wed Feb 23, 2005 7:07 am
Posts: 4
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0

Hi,

a litle question
when using the join mapping for two tables does it nesseccary does the join on the primary key of the first table ? or there is a way to select an other unique column from the first table ?


Mapping documents:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping>
<class name="multiTable.domain.Employe" table="EMPLOYE">
<id name="id" type="string">
<column name="EMP_ID" not-null="true" />
</id>

<join table="PRENOM" inverse="true">
<key column="PRE_ID"/>
<property name="prenom" column="PRE_VAL" not-null="true"/>
</join>

</class>
</hibernate-mapping>


Regards,
Marc


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 1:05 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Join has to be on the PK.
You can still use OneToOne to match your needs

_________________
Emmanuel


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

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.