users@glassfish.java.net

clever entity updates

From: <glassfish_at_javadesktop.org>
Date: Mon, 12 Jul 2010 07:29:09 PDT

I have an application which is obtaining data from external XML source (Oracle AQ). Everything seems to be fine when it gets completely new data, but when the message contains existent data system should perform update instead of insert. Master entity (person) has some restrictions which hare not checked by EJB when performing merge method (because of bidirectional relationship it is always run merge, never persist). I understand that entity merge method checks entity existence by their primary key (auto-increment integer field in MySQL) but not checking other unique constraints.
How to force EJB to check unique keys instead of primary key which is always different?
[Message sent by forum member 'smoczyna']

http://forums.java.net/jive/thread.jspa?messageID=477351