Hi all.

I'm trying to use a GeneratedIdTable generator and I have the follwoing 
configuration:

A top level annotation at the beginning of the class:

@javax.persistence.GeneratedIdTable(  name="GENERATOR",
        [EMAIL PROTECTED](name="SEQUENCE_TABLE"), 
        pkColumnName="SEQUENCE_ID", 
        valueColumnName="SEQUENCE_VALUE")

public class aClass implements java.io.Serializable {

....
....
@Id(generate=GeneratorType.TABLE, generator="aGenerator")
    @TableGenerator(name="aGenerator", tableName="GENERATOR", 
pkColumnValue="USER", allocationSize=20)
    @Column(name = "USER_ID", unique = true, nullable = false, insertable = 
true, updatable = true, precision = 22, scale = 0)
    public Long getUSERId() {
        return this.userId;
    }


In the database I have the SEQUENCE_TABLE table with SEQUENCE_ID and 
SEUQNCE_VALUE fields. I have a row with the pair of values

SEQUENCE_ID | SEQUENCE_VALUE
USER                        |  100

so, the next value of the userId field (when I persist a new User) should be 
100 and the table columnSEQUENCE_VALUE value with SEQUNCE_ID = 'USER' should 
pass to 101. 

But what happens is that the value on the table row passes to 101 but the 
userId  field value in the newly created user is somehow random (11201, 1060). 
Am I doing (or thinking) someting wrong or is this a bug?

regards

RM

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3918706#3918706

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3918706


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to