collection « Validation « JPA Q&A





2. Hibernate validator and lazy collections    forum.hibernate.org

I came across an interesting problem recently and could not find any information about it in the docs. Basically I had an @AssertTrue validation method that was causing a lazy collection to become initialized , which then resulted in a "collection [my.object.collection] was not processed by flush" assertion failure. I could not find anything about this in the docs and I ...

3. Hibernate Validator for collections    forum.hibernate.org

Hibernate version: 3.3.0 With the Hibernate Validator (release version 3.3.0 GA I believe) is it possible to put an Annotation for an entity collection.. Basically, I want to be able to type an annotation for each elements of a collection on the one-to-many relation... Ex : public class Owner { @OneToMany(mappedBy="owner",cascade={CascadeType.ALL}) @AnnotationToValideCollections(Pet.property="NotNull", messsage="Pet.property is invalids") private Set pets; } Where "@AnnotationToValideCollections" ...

4. Hibernate custom validator fails on one to many collection    forum.hibernate.org

Hi there, I am using Hibernate via JPA, in other words EntityManager. I have written a custom validator annotation that checks a OneToMany relationship for the size of the Set: Code: ... public class AssertOptionsValidator implements Validator, PropertyConstraint { @Override public void initialize(AssertOptions arg0) {} @SuppressWarnings("unchecked") ...