-->
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.  [ 2 posts ] 
Author Message
 Post subject: Migration to 3 - Select PK Id Starts From 4294967297
PostPosted: Tue Sep 27, 2005 11:26 am 
Newbie

Joined: Tue Sep 27, 2005 11:07 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

3.0

Mapping documents:

<class
name="it.sella.cms.hbm.CmsMaCategory"
table="cms_ma_category"
>

<id
name="cgId"
type="java.lang.Long"
column="cg_id"
>
<generator class="identity"/>

</id>

Code between sessionFactory.openSession() and session.close():

List l = s.createQuery("from it.sella.cms.hbm.CmsMaCategory as st").list();

int size = l.size();
for(Iterator itr=l.iterator();size>0;size--){
CmsMaCategory st = (CmsMaCategory)itr.next();
s.evict(st);
LOG.info("st id/nme: "+st.getCgId()+"/"+st.getCgNme()+"/"+st.getCgDescr());
}

Full stack trace of any exception that occurs:

None.

Name and version of the database you are using:

MySQL 4.1

The generated SQL (show_sql=true):

select cmsmacateg0_.cg_id as cg1_, cmsmacateg0_.cg_nme as cg2_8_, cmsmacateg0_.cg_descr as cg3_8_ from cms_ma_category cmsmacateg0_

Debug level Hibernate log excerpt:

The DB query (hibernate generated sql) produces:

Code:
mysql>  select cmsmacateg0_.cg_id as cg1_, cmsmacateg0_.cg_nme as cg2_8_, cmsmacateg0_.cg_descr as cg3_8_ from cms_ma_category cmsmacateg0_
    -> ;
+------+--------+-----------------+
| cg1_ | cg2_8_ | cg3_8_          |
+------+--------+-----------------+
|    1 | Java   | Java Category   |
|    2 | Oracle | Oracle Category |
+------+--------+-----------------+
2 rows in set (0.00 sec)


But when I run the program, I get the output:

Code:

Hibernate: select cmsmacateg0_.cg_id as cg1_, cmsmacateg0_.cg_nme as cg2_8_, cmsmacateg0_.cg_descr as cg3_8_ from cms_ma_category cmsmacateg0_
2005-09-27 20:09:26,157 [main] INFO  Test - st id/nme: 4294967297/Java/Java Category
2005-09-27 20:09:26,158 [main] INFO  Test - st id/nme: 4294967298/Oracle/Oracle Category



Why is Hibernate not displaying the correct id corresponding to Java (1) and Oracle (2)? This is an application which was previously working in Hibernate2. After migration to 3.0, we are facing this.

Thanks in Advance.


Top
 Profile  
 
 Post subject: This is a bug in JDBC driver
PostPosted: Thu Sep 29, 2005 12:05 pm 
Newbie

Joined: Tue Sep 27, 2005 11:07 am
Posts: 2
http://bugs.mysql.com/bug.php?id=12244


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

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.