-->
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: @GenericGenerator SequenceStyleGenerator
PostPosted: Fri Aug 22, 2008 2:49 am 
Newbie

Joined: Sat Jan 19, 2008 8:21 am
Posts: 3
Hello

Currently I have two objects where their ids are generated using theese annotations


@Id
@GeneratedValue(generator = "sagIdGenerator")
@GenericGenerator(
name = "sagIdGenerator",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {
@Parameter(name = "initial_value", value = "" + ID_INITIAL_VALUE),
@Parameter(name = "force_table_use", value = "true"),
@Parameter(name = "value_column", value = "SAG_ID"),
@Parameter(name = "sequence_name", value = "TETL_SAG_SID")
}
)

and

@Id
@GeneratedValue(generator = "tingbogIdGenerator")
@GenericGenerator(
name = "tingbogIdGenerator",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {
@Parameter(name = "initial_value", value = "" + ID_INITIAL_VALUE),
@Parameter(name = "force_table_use", value = "true"),
@Parameter(name = "value_column", value = "TINGBOG_ID"),
@Parameter(name = "sequence_name", value = "TETL_TINGBOG_ID")
}
)

This works fine but what I dont like is that Im creating two tables one for each sequence key. Id like the table name to be the same on both annotations (sequence_name) but if I do so it will make the table but only with the first annotations column. So when I try to persist the first tingbogs object it will fail saying that there is no TINGBOG_ID column the sequence table. Does anyone have a suggestion to what I could be doing wrong or is there simply a bug in the hibernate code?


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.