-->
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: Composite Id, is this approach possible w/ Hibernate?
PostPosted: Tue Jan 31, 2006 11:53 am 
Newbie

Joined: Mon Dec 05, 2005 4:22 pm
Posts: 8
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.1

Mapping documents:

<id name="wrkflowgroupmatchid" type="integer">
<column name="WRKFLOWGROUPMATCHID" precision="5" scale="0" />
<generator class="increment" />
</id>

<property name="memberid" type="integer">
<column name="MEMBERID" precision="5" scale="0" not-null="true" />
</property>

<property name="wrkflowgrouptypid" type="integer">
<column name="WRKFLOWGROUPTYPID" precision="5" scale="0" not-null="true" />
</property>

<property name="startdt" type="timestamp">
<column name="STARTDT" length="7" not-null="true" />
</property>

<property name="enddt" type="timestamp">
<column name="ENDDT" length="7" not-null="true" />
</property>

<property name="wrkflowgroupname" type="string">
<column name="WRKFLOWGROUPNAME" length="100" not-null="true" />
</property>

<property name="sequence" type="integer">
<column name="SEQUENCE" precision="5" scale="0" not-null="false" />
</property>


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

Here is my table:
WorkFlowGroups
workflowgroupid
memberid
startdate
enddate
name
sequence

First, I ask that you please don't slam the normalization of the table, I have no control over that. :)

Now, onto the actual problem. In order for this table to work, workflowgroupid and memberid both have to be part of the key. However, when creating a new record I would like workflowgroupid to be incremented by Hibernate and memberid assigned by the user.

Is this mapping possible w/ Hibernate?

Thank you.


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.