4 Replies Latest reply on Apr 30, 2008 1:20 PM by Mohammad Norouzi

    regarding @PrePersist and ID assignment

    Mohammad Norouzi Novice

      Hi all
      I have an entity in which I need to assign my own ID to its primary key,
      I put the code to extract the id and set it to the field in a PrePersist method, however, the ejb validates the entity before calling that callback method so the exception will be thrown

      my question is where should I put this code or how can I say the EJB not to validate before persisting!

      any comment would be of great help