-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Entity Exists exception...
PostPosted: Mon Oct 02, 2006 12:28 pm 
Newbie

Joined: Sun Jun 25, 2006 9:27 pm
Posts: 18
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 09, 2006 4:37 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you shoud be able to pass a transient (to be saved) or a detached (to be updated) object to merge without any issue
You don't give much explaination so I can't really go any further

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.