users@glassfish.java.net

Re: RE: persistence: ommiting sequence for ID?

From: <glassfish_at_javadesktop.org>
Date: Thu, 24 May 2007 07:39:30 PDT

I wouldn't be so naive to post a message without checking the first scenario...

I was trying to do that, but even though have I supplied an Id for this entity - I found it in database with another value, generated by the sequence.

I'm using glassfish v1_01 , toplink, and postgresql 8.2. Maybe strange configuration of entity? or some configuration of EM?

@Id
    @Column(name = "user_id", nullable = false)
    @SequenceGenerator(name="users_user_id_seq", sequenceName="users_user_id_seq")
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="users_user_id_seq")
    private BigInteger userId;
[Message sent by forum member 'kretes' (kretes)]

http://forums.java.net/jive/thread.jspa?messageID=218732