[jboss-user] [JBoss Seam] - data validation

jamesjmp do-not-reply at jboss.com
Tue Nov 27 04:42:42 EST 2007


hi,
in a form I want to validate that the code asigned in a field is one that already exists.
For instance, I´ve a field for currencies. I have a table for them, and I want to check that the currency filled is already on the database to avoid foreign keys problems.
I´ve found 2 solutions. The first is to override persist method and there by means of a query to check if that value is ok. 
The second is to add a try-catch in the persist, and in the catch check if there has been an Exception like this

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing:...

Is there a better "seam-way" of validating this?
thanks in advance!

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

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




More information about the jboss-user mailing list