Hello,
I'm using JBoss 3.2.3 with Oracle 8.
Our DB team usually designs the table with a surrogate key (sequence based) and then 
adds a UNIQUE constraint to the "natural" key of the table.
For instance, this table:

  | COUNTRY
  |    COUNTRY_ID
  |    CODE
  |    NAME
  | 

will have a sequence for COUNTRY_ID, and a UNIQUE constraint for CODE (as that's the 
natural key).
How can I map this with JBoss? Currently I mapped COUNTRY_ID as the pk-field, but 
whenever JBoss tries to insert a new record with a duplicated CODE value, I'll get a 
EJBCreateException (and not a duplicate key error, as I'll need to show the users).
Is there any way to map this DB design into JBoss?

What other suggestions do you have?

Thanks in advance.

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

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


-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite!  GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to