-->
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.  [ 4 posts ] 
Author Message
 Post subject: two primary key in one table
PostPosted: Fri Mar 12, 2004 12:04 am 
Beginner
Beginner

Joined: Fri Feb 27, 2004 3:49 am
Posts: 25
following is database structure for my situation.

table: LocStock
-----------------
LocCode (primary key)
StockId (primary key)
quality

how to write hbm file to generate table like this?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 6:39 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Use composite-id

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 14, 2004 9:24 pm 
Beginner
Beginner

Joined: Fri Feb 27, 2004 3:49 am
Posts: 25
<composite-id>
<key-many-to-one name="warehouseCode" class="com.creativesol.erp4all.model.Warehouse" column="WarehouseCode"/>
<key-many-to-one name="stockId" class="com.creativesol.erp4all.model.Inventory" column="StockId"/>
</composite-id>

this tag added into the mapping file and able sun properly. my problem
is how to using xdoclet hibernate tag in my object class to generate that code automatically into my mapping file?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 12:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Do a search on the forum. Its been discussed many times - even recently (look into tools first).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.