-->
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: wrong generated id when using "increment"
PostPosted: Fri Oct 08, 2004 12:28 am 
Newbie

Joined: Tue Aug 24, 2004 4:25 am
Posts: 14
Hibernate version:2.1.6

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping package="com.psca.M24000.bo">

<class name="Content" table="TBL_CONTENT">

<id name="id" column="ID" type="long" unsaved-value="null">
<generator class="increment"/>
</id>

<property name="type" column="TYPE" type="string"/>
<property name="name" column="NAME" type="string"/>
<property name="path" column="PATH" type="string"/>
<property name="interval" column="INTERVAL" type="int"/>
<property name="param" column="REPORT_PARAM" type="string"/>
<property name="order" column="SEQ_ORDER" type="int"/>
<property name="desc" column="DESCRIPTION" type="string"/>

<many-to-one name="owner" column="OWNER_ID" class="User" not-null="true"/>

<many-to-one name="tvGroup" column="TVGROUP_ID" class="TVGroup" not-null="true"/>

<!-- Apply to all object derrived from BaseBO -->
<property name="createdBy" column="CREATED_BY" type="string"/>
<property name="createdDt" column="CREATED_DT" type="timestamp"/>
<property name="lastModifiedBy" column="LAST_MODIFIED_BY" type="string"/>
<property name="lastModifiedDt" column="LAST_MODIFIED_DT" type="timestamp"/>
</class>

</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
session.save(objContent);


Full stack trace of any exception that occurs:

Name and version of the database you are using:Oracle 8.1.7

The generated SQL (show_sql=true):
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.SQL - insert into TBL_CONTENT (TYPE, NAME, PATH, INTERVAL, REPORT_PARAM, SEQ_ORDER, DESCRIPTION, OWNER_ID, TVGROUP_ID, CREATED_BY, CREATED_DT, LAST_MODIFIED_BY, LAST_MODIFIED_DT, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'FILE' to parameter: 1
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'withmusic.ppt' to parameter: 2
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'withmusic.ppt' to parameter: 3
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.IntegerType - binding '10' to parameter: 4
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding '' to parameter: 5
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.IntegerType - binding '99' to parameter: 6
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'test' to parameter: 7
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'admin' to parameter: 8
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'TVG1' to parameter: 9
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'admin' to parameter: 10
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.TimestampType - binding '2004-10-08 12:19:09' to parameter: 11
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.StringType - binding 'admin' to parameter: 12
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.TimestampType - binding '2004-10-08 12:19:09' to parameter: 13
[08-10-2004 12:19:09] DEBUG net.sf.hibernate.type.LongType - binding '1' to parameter: 14


Debug level Hibernate log excerpt:

The details as above.
My problem is the id stored in database is 2.06E22, not '1' as expected.
I do not know why?
Any help is appreciated.


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.