Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2.2 GA
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.wealthsystems.sim.model.entity">
<class name="Pais" table="PAIS">
<id name="idPais" column="IDPAIS" type="long"></id>
<property name="sigla" not-null="true" length="10"/>
<property name="descricao" not-null="true" length="80"/>
<property name="nacionalidade" length="80" />
<property name="idnAtivo" not-null="true" type="byte" />
<property name="idnPaisPadrao" type="byte" />
<property name="codigo" length="20" />
</class>
</hibernate-mapping>
In this moment i need discover what property of my entity is primary key.
I Write a method getPrimaryKeyProperty, but i donĀ“t know how to discover what property is my primary key in run time execution.
public String getPrimaryKeyProperty(){}
Any one, say me what class of the Hibernate Core answer my question.
What class of the Hibernate Core return the name of primary key of the entity?