-->
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: Using Composite id
PostPosted: Fri Jan 20, 2006 5:06 am 
Newbie

Joined: Wed Nov 30, 2005 10:54 am
Posts: 13
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.1

Name and version of the database you are using: Oracle 9


Hi,

I would like to map the following table :


create table DIPLOME
(
COD_DIP VARCHAR2(20) not null,
VERSION_DIP VARCHAR2(20) not null,
LIB_DIP VARCHAR2(100) not null,
DATE_DIP DATE not null,
constraint PK_DIPLOME primary key (COD_DIP, VERSION_DIP)
)

I would like to know how to map this table, do I have to use a composite-id ?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 20, 2006 8:24 am 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
Yes, you will

Your composite ID will be something like:
Code:
        <composite-id>
            <key-property name="cod_dip" column="cod_dip" type="java.lang.String"/>
            <key-property name="version_dip" column="version_dip" type="java.lang.String" />         
        </composite-id> 


Hope it helps.

_________________
Don't forget to rate if the post helped!


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.