Joined: Fri Apr 02, 2010 8:40 am Posts: 9
|
Hi all,
is there any way how to find out which attribute of hibernate mapped class is used as primary key ?
e.g
<hibernate-mapping> <class name="Component" table="component" schema="public"> <id name="id" type="string"> <column name="id" length="36" /> <generator class="uuid" /> </id> <many-to-one name="component" class="Component" fetch="select"> <column name="parent_id" length="36" /> </many-to-one> </class> </hibernate-mapping>
in this case primary key is id attribute as I'm using generator class for this.
Is there some other attribute I've to add to mapping in order to hibernate recognize that it's primary key ?
I've tried ClassMetadata.getNaturalIdentifierProperties() but it returned empty list ... any ideas ??
thanks
|
|