aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes fk / pk constraint name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "fk / pk constraint name" Watch "fk / pk constraint name" New topic
Author

fk / pk constraint name

Bernhard Neuhauser
Greenhorn

Joined: Feb 06, 2006
Posts: 21
Is it possible to tell the ejb3 layer the name of constraints?

For example a PK's name will be something like SYS_C0000123 using oracle. Something like PK_TABLE_ID would be helpful, because when a insert statement violates the constraint, the db will tell me the constraint name.

Maybe its implemention specific - currently im using jboss AS for ejb3 persistence.

thanks,
Bernhard
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Unfortunately, you only get the Oracle name back. You can always have Oracle not automatically name the contraint for you and have your DDL give it a name, then you will see a nicer name.

This is an Oracle issue and not related to EJB or any App Server.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Bernhard Neuhauser
Greenhorn

Joined: Feb 06, 2006
Posts: 21
You are wrong, the issue has nothing to do with the chosen database.

This is mainly an ejb3 issue (or better said an issue of the mapper behind ejb3).

In my case, its hibernate. Hib generates the ddl based on the information taken from the ejb3 annotations. So the question is, how to tell the ejb3 layer to generate the ddl in a proper way.

cybi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fk / pk constraint name