panigrahi.v wrote:
<?xml version='1.0' encoding='windows-1252'?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Employee" table="EMPLOYEE">
<id name="id" column="EMP_ID" type="java.lang.Integer" >
<generator class="sequence"/>
</id>
<property name="name" column="EMP_NAME" type="java.lang.String" />
<property name="sal" column="SAL" type="java.lang.Double" />
</class>
</hibernate-mapping>
Well, I guess you're just missing the parameter for the sequence id generator. Have you read the ref doc ?
http://www.hibernate.org/hib_docs/v3/re ... -sequences
Code:
<id name="id" type="long" column="person_id">
<generator class="sequence">
<param name="sequence">person_id_sequence</param>
</generator>
</id>
But, you seem to be using MySQL, are you sure it supports sequences ? Maybe you should try using "identity" id generator instead.
Code:
<id name="id" type="long" column="person_id" unsaved-value="0">
<generator class="identity"/>
</id>
If your app could be used on another db, you could also try and use the "native" generator, which would choose identity on mysql for example, and sequence for Oracle or Postgres.