-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem to using generator class native..
PostPosted: Sun Apr 04, 2010 3:18 am 
Newbie

Joined: Sat Apr 03, 2010 2:47 pm
Posts: 1
Location: India
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.