[jboss-user] [EJB 3.0] - Duplicate Entry problems with Persistence

bluetrade do-not-reply at jboss.com
Mon Oct 2 12:10:11 EDT 2006


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975547#3975547

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975547



More information about the jboss-user mailing list