Hello Sir,
I have Oracle database,It's properly configured with hibernate.
I am facing problem to generate primary key using generator class native.when this code executes it always tried to save null in column:id .although this column already set as primary in database.I mean to say key is generating as the native property says.
Please any one suggest what wrong i have done...
Code:
[b]Hibernate mapping[/b]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
This mapping demonstrates content-based discrimination for the
table-per-hierarchy mapping strategy, using a formula
discriminator.
-->
<hibernate-mapping
package="org.hibernate.test.discriminator"
default-access="field">
<class name="Person" table="SPerson">
<id name="id" column="person_id">
<generator class="native">
</generator>
</id>
</class>
</hibernate-mapping>
While executing This query is running[insert into SPerson (person_id) values (null)]
I have created SEQUENCE namely
hibernate_sequence