4 Replies Latest reply on Oct 2, 2006 3:03 PM by flo thomas

    ConstraintViolation & redundant entries

    flo thomas Newbie

      Hi,
      i have a problem with persisting entities and get ConstraintViolationExceptions . In Hibernate, there is a saveOrUpdate feature that is missing in the EJB 3.0 Persistence specification, as far as I know merge is not the same (and that didn't work for me anyways). I have a Text-Object that contains Sentence Objects which in turn contain words. Now I don't want to have double entries of certain words but rather e.g. persisting "This car is his car" should not add two times "car" into the DB. To avoid that, I tried using the actual token (String token of Word Object) as the PK but that results in ConstraintViolationExceptions...

      Any clues?


      Thanks,
      Joey