-->
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: How to use 2 composite-id in hbm.xml
PostPosted: Mon Nov 29, 2010 2:14 pm 
Newbie

Joined: Mon Nov 29, 2010 2:02 pm
Posts: 1
Could you pls tell, is it possible to use 2 composite-id in a single mapping like the following code snippet. If it's wrong how to use 2 referance variable in a single hbm.
-----------------------------------------------------------------------
Table Name: employee
coulmn : empNo,Name,Address.
constrain(empNo,Name)


class A
{

private B obj1;
private C obj2;
private String address;

get/set();
}

class B
{
private int emp_no;
get/set();
}

class C
{
private String name;
get/set();
}

mapping:

<class name="A" table="employee">

<composite-id name="obj1" class="B">
<key-property name="emp_no" type="int" column="empNo"/>
</composite-id>

<composite-id name="obj2" class="C">
<key-property name="name" type="string" column="name"/>
</composite-id>

<property name="address" column="Address" type="string"/>

</class>
---------------------------------------------------------------------------------


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.