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?
|