I have a composite key with 2 fields.  1 field is an auto-incrementing field, 
the other is a foreign key.  I've been trying to put @GeneratedValue annotation 
on the auto-incrementing field, but can't seem to get it to work properly.  Is 
this supported?  I assumed thats why it was broken out of the @ID annotation so 
that it could be used on any field.

This is a major setback to our development if this isn't supported.  

-----  Customer Class -----
        @EmbeddedId
        @AttributeOverrides( {
                @AttributeOverride(name = "customerId", column = @Column(name = 
"customer_id", unique = false, nullable = false, insertable = true, updatable = 
true)),
                @AttributeOverride(name = "carrierId", column = @Column(name = 
"carrier_id", unique = false, nullable = false, insertable = true, updatable = 
true))})
        public CustomerId getId()
        {
                return this.id;
        }

-------  CustomerId class ---------------

        @GeneratedValue(strategy= GenerationType.AUTO)
    @Column(name = "customer_id", unique = true, nullable = false, insertable = 
true, updatable = true)
        public Integer getCustomerId()
        {
                return this.customerId;
        }
    
    @Column(name = "carrier_id", unique = false, nullable = false, insertable = 
true, updatable = true)
    public Integer getCarrierId()
    {
        return this.carrierId;
    }

-------------------------------------------

Thanks

Nic

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

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


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to