"Dynamic" java validation framework?

Posted by pihentagy on Stack Overflow See other posts from Stack Overflow or by pihentagy
Published on 2010-05-19T09:01:03Z Indexed on 2010/05/19 14:50 UTC
Read the original article Hit count: 254

Filed under:
|
|
|

AFAIK JSR-303 is the standard bean validation system.

I don't know whether it could do validations like this (I guess no):

  • if an object has a deleted flag set, you cannot modify the object
  • you cannot change the start date property, after the date is passed
  • you cannot decrease some integer properties in the bean

So how can I handle validations, which depend on the previous state of an object?

I would like to solve problems like that in hibernate3.5 - spring3 - JPA2 environment.

Thanks


My solution was to mess with hibernate, reload the object to see the old state (after evicting the new object). This time I need some smarter solution...

© Stack Overflow or respective owner

Related posts about jsr303

Related posts about hibernate