Dear all,
i read hibernate will create the primary key automatically with mapping file(.hbm.xml)then why should we create the primary key while creating the table.
i creat the table like the following:
create table test(id int ,name varchar(10),sex varchar(10));
the hbm file is following:
<?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>
<class name="com.re.test.keys.Testing" table="testing">
<id name="id" type="int" column="ID">
<generator class="increment"/>
</id>
<property name="name">
<column name="NAME" />
</property>
<property name="sex">
<column name="SEX"/>
</property>
</class>
</hibernate-mapping>
if i do it will create primary key automatically.anybody please help me
regards,
sathya
|