-->
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.  [ 3 posts ] 
Author Message
 Post subject: TableHiloGenerator - single table for multiple sequences ?
PostPosted: Fri Jan 30, 2004 7:06 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Little question to the community:
Does it make sense to have a single hi_value table containing a record with the next high value per id sequence ?

Currently, if you want distinct id sequences per persistent entity when using the TableHiloGenerator, you have to create one table per persistent entity.

Maybe this strategy could be upgraded to support a single table with several records in it...

Does it make sense or does it open the door to any potential problem or performance penality ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 11:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I've considered that. But you can always implement it yourself... Many applications define their own IdentifierGenerator.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 11:49 am 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
Was looking at it...

But I faced a problem for which I don't have any solution.

The TableGenerator is a PersistentIdentifierGenerator. As such it returns the SQL create statement for the persistent table.

If the same table is shared by different generators, the create statement will be different (the frist will be an actual create while the others will just add the initial value).

Unfortunately, the SessionImplementor is not available within the sqlCreateStrings() - so there is no way to know if the table already exists (besides using 'if exist' statement in the sql itself - but this is not supported by all databases).

Any idea ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.