• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

fk / pk constraint name

 
Bernhard Neuhauser
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bernhard Neuhauser
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic