In my Hibernate Application i'm using create a ValueObject class
@Entity
@Table(name="user")
public class UserVO{
@Id
@Column(name="S_ID")
private String s_id;
@Column(name="FIRSTNAME")
private String firstName;
@Column(name="LASTNAME")
private String lastName;
}
and in my Service class i'm writing like this
public void createOrUpdateUser(UserVO userVO) {
userDAO.createOrUpdateUser(userVO);
}
and in my DAO class i'm writing like this
private EntityManager entityManager;
public void createOrUpdateUser(UserVO userVO) throws DataAccessException {
entityManager.persist(userVO);
}
now i'm calling createOrUpdateUser(userVO) but it give error
Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save()
Actually my data base i have created one trigger
for user
table to generate unique id for s_id
column is their any problem for trigger..please suggest me..