-
1. Re: How to use validation on non-entity beans?
gavin.king Nov 1, 2005 7:49 PM (in response to rdewell)Um ... it should work ;)
-
2. Re: How to use validation on non-entity beans?
rdewell Nov 1, 2005 8:34 PM (in response to rdewell)From what I can tell, it doesn't work. :)
I looked through the Seam booking example and could only find instances of it @Valid'ating dependent entities -- no examples of @Valid'ating dependent session beans.
I've tried a number of variations on my bean that contains the dependent bean (SomeAction.class). Stateful/Stateless, and making the the Order transient/non-transient. It's just not happening at all. "success" is returned no matter what, and Order is most definitely invalid.
Is there any specific logging I should look at to confirm this? -
3. Re: How to use validation on non-entity beans?
gavin.king Nov 1, 2005 8:41 PM (in response to rdewell)Try stepping through the code in your debugger.
-
4. Re: How to use validation on non-entity beans?
patrick_ibg Nov 2, 2005 11:14 AM (in response to rdewell)Make sure Order is not null...
That said, I also have a small problem with Hibernate Validations... it seems that the validator does not recursively validate @Embeddable classes. -
5. Re: How to use validation on non-entity beans?
gavin.king Nov 2, 2005 12:50 PM (in response to rdewell)Right, you need to mark the reference to the @Embeddable as @Valid. This is reasonable, I think. Validator should not "automatically" follow references to other objects.
-
6. Re: How to use validation on non-entity beans?
patrick_ibg Nov 2, 2005 1:53 PM (in response to rdewell)I did have the @Embeddable marked as @Valid. Turns out to be a bug in the Validator. Here's a reference to the JIRA issue:
http://opensource2.atlassian.com/projects/hibernate/browse/ANN-137