Joined: Wed Nov 02, 2005 12:08 am Posts: 7 Location: Sydney,Australia
|
Hi,
I have a table that has a primary key and a composite key. I am wondering whether it is possible to map it with an id name as well as with a composite_id name or whether they were mutually exclusive.
eg
<id name="OptionId" type="integer" column="OptionId" unsaved-value="-1">
<generator class="assigned"/>
</id>
<composite-id
name="Id" >
<key-property name="CAId" type="java.math.BigDecimal" column="CAId"/>
<key-property name="ProdType" type="integer" column="ProdType"/>
</composite-id>
The table definitions are :
alter table HIN_CAOptions
add constraint HIN_CAOptions_PK PRIMARY KEY (OptionId)
alter table HIN_CAClientOptions
add constraint HIN_CAClientOptions_PK PRIMARY KEY (OptionId, EntId)
thanks in advance.
|
|