bean-validation

"Dynamic" java validation framework?

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 v...

Spring + App Engine + JSR303

I am new to Spring and having issues with JSR303 Validation. The problem appears to be with the <mvc:annotation-driven/> tag in spring-servlet.xml. When I include this tag I get the following error on startup of the development server. SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Er...

JSF/Hibernate NotBlank validation.

I have a simple JSF+RichFaces form with some fields and obviously a backing bean to store them. In that bean all the necessary properties have validation annotations (jsr303/hibernate), but I can't seem to find an annotation which would check if the property (String) is blank. I know there's a @NotBlank annotation in spring modules, but ...

JPA2 on Tomcat - possible?

I'd like to use JPA along with Bean Validation, so JPA 2.0 sounds like what I need. I'm running my web application on Tomcat 6. Is Tomcat able to use JPA2? ...

Unique constraint with JPA and Bean Validation

I'd like to have a @Unique constraint with Bean Validation, but that is not provided by the standard. If I would use JPA's @UniqueConstraint I wouldn't have a unique validation and error reporting mechanism. Is there a way to define @Unique as a Bean Validation constraint and combine it with JPA, such that JPA creates a column with an u...

hibernate validator

Hi, I'd like to use hibernate (orm) together with hibernate validator. Within the documentation we can find the following: Out of the box, Hibernate Annotations (as of Hibernate 3.5.x) will translate the constraints you have defined for your entities into mapping metadata. For example, if a property of your entity is annot...

Stop Hibernate from creating not-null constraints

Is there a way to stop Hibernate from creating not-null constraints for properties annotated with @javax.validation.constraints.NotNull when using hbm2ddl = create? ...

How can I apply a @NotNull constraint to all fields in a class using javax.validation?

I'm using the hibernate implementation of the javax.validation and would like to know how whether anyone has been able to apply the @NotNull constraint annotation to all fields of a class, rather than to each individual field? I would prefer to enforce the @NotNull constraint as a default across my project, to avoid littering the code w...

h:messages gives no output

Hello, I'm learning about bean validation. I have created simple form with username and password input fields which are bound through backing bean to model (User) properties username and password. I have marked them with annotation: @Id @NotNull(message="Username cannot be empty") private String username; @NotNull(message="Password can...

Validating Integer using JSR303

Hey, I decided to use JSR303 to validate my forms in Spring 3.0 MVC application. When i try to check @NotEmpty on Integer variable i have exception: javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Integer Firts this variable was declared as int (protected int partCount) but I found on spring fo...

Why session bean method throw EjbTransactionRolledbackException when RuntimeException was thrown

Hi All! I am trying to persist the entity with constraint validation, when invoke persist - there is constraint that thrown and the caller get EjbTransactionRolledbackException... so I try to call the validation explicit and throw ConstraintViolationException/RuntimeException and still the caller get EjbTransactionRolledbackException......

nested Annotation List in Scala

Help, how do i do stuff like the following in Scala? import org.hibernate.validator.constraints.ScriptAssert @ScriptAssert.List({ @ScriptAssert(script = "...", lang = "javascript"), @ScriptAssert(script = "...", lang = "javascript")}) ...

How to set check order for JSR303 bean validation

I use the JSR303 Bean Validation to check the form input. @NotBlank @Size(min = 4, max = 30) private String name; @NotBlank @Size(max = 100) @Email private String mail; when then name = '' and email = '',the @NotBlank, @Size at name, @NotBlank, @Size, @Email at mail will be checked. I want set the check order, when the previous or...

javax.validation.ValidationException: Unable to find default provider

Hi there, I am currently working on Spring MVC web app and trying to hook up validation using the @Valid annotation. When I fire up the application I'm getting the following exception: javax.validation.ValidationException: Unable to find a default provider I have Hibernate Validator 3.1.0.GA on the classpath as well as javax validat...

Python validation API

I'm looking for a Python (<3) validation API something like Java's Bean Validation or Spring validation. I'm not looking for a library that is limited to form validation, since I want to validate domain objects. Do you know a Python API for validating of domain objects? ...