-->
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: TableHiLoGenerator and longs
PostPosted: Wed Nov 02, 2005 5:35 pm 
Beginner
Beginner

Joined: Sat Oct 29, 2005 2:05 am
Posts: 21
Location: Kansas City, KS
I am attempting to use the hilo generator where the column is a long. Looking at the TableHiLoGenerator class, it appears to me that the generation goes through a step in which it is converted to an int. The particular method is:

TableGenerator.doWorkInCurrentTransaction(Connection conn, String sql)

Within this method, we perform the select query to get the next value, then perform the update to increment the counter. However, we extract the select query resultSet with:

result = rs.getInt(1);

And we update the query with:

ups.setInt( 1, result + 1 );
ups.setInt( 2, result );

If I'm not mistaken, those ...Int() methods are bugs. Instead, these get/set methods should be delegated to the IdentifierGeneratorFactory class (which has a get method but would need a set).

Working with the rc2 release.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 2:23 pm 
Beginner
Beginner

Joined: Sat Oct 29, 2005 2:05 am
Posts: 21
Location: Kansas City, KS
I was mistaken. Thanks for Emmanuel Bernard for the correction.


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.