Hi to all...i have an entity bean (UserEBean) and its "Id" is defined like:
@Id(generate=GeneratorType.SEQUENCE, generator="USERS_SEQ")
@javax.persistence.SequenceGenerator(
name="USERS_SEQ",
sequenceName="users_user_id_seq"
)
@Column(name="user_id", nullable=false)
public Long getUserId() {
return userId;
}
Respective session bean has the method:
public void save(UserEBean bean)
{
// TODO Auto-generated method stub
manager.persist(bean);
}
In an other class i set properties in an UserEBean variable and then i call:
userDAO.save(my_userbean);
How can i get the entity's ID which i just persisted?
Thanks to all!
Paolo.
|