Thread:
 re: db constraints 
 steve   16 Apr 2004, 02:02 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: steve (16 Apr 2004, 02:02) Replies: 0, Views: 38320
Subject: re: db constraints
There is actually (what I think is) a very elegant and simple solution 
to the issue you bring up.  What we do to to explicitly define our 
constraints (we never use the schema generation stuff), which gives 
you the ability to name the constraint.  Then, when an exception does 
occur we (using the Spring framework) convert the jdbc exception to 
spring's DataAccessException.  If the exception happens to be 
something like a constraint violation, we then parse the name of the 
contraint violated and use the name in a resource bundle lookup for 
display to the end user.  Can't get much more user friendly than that; 
and I don't have to jump through any more hoops than necessary to do 
this vaidation thing.
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]