title: How to give Trigger generated value into Hibernate ValueObject?
body: <p>In my Hibernate Application i'm using create a ValueObject class </p>
  
  <pre><code>@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;
   }
  </code></pre>
  
  <p>and in my Service class i'm writing like this</p>
  
  <pre><code>public void createOrUpdateUser(UserVO userVO) {
          userDAO.createOrUpdateUser(userVO);
      }
  </code></pre>
  
  <p>and in my DAO class i'm writing like this</p>
  
  <pre><code>private EntityManager entityManager;
  public void createOrUpdateUser(UserVO userVO) throws DataAccessException {
          entityManager.persist(userVO);
      }
  </code></pre>
  
  <p>now i'm calling createOrUpdateUser(userVO) but it give error</p>
  
  <pre><code>Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save()
  </code></pre>
  
  <p>Actually my data base i have created one <code>trigger</code> for <code>user</code> table to generate unique id for <code>s_id</code> column is their any problem for trigger..please suggest me..</p>