Over a million developers have joined DZone.

OpenXava 3.0.1: Hibernate Validator Support


OpenXava is a JPA Application Engine. You put in your JPA classes and, in exchange, you obtain a full-featured application ready for production, and without code generation. Since OpenXava 3.0.1, which was released this week, Hibernate Validator is fully supported.

So now you can write a Java class like this:

public class DrivingLicence {

@Id @Column(length=2) @Stereotype("NO_FORMATING_STRING")
private String type;

@Id @Max(2)
private int level;

@Column(length=40) @Required
private String description;

public String getDescription() {
return description;

public void setDescription(String description) {
this.description = description;

public int getLevel() {
return level;

public void setLevel(int level) {
this.level = level;

public String getType() {
return type;

public void setType(String type) {
this.type = type;


And you will have an application module as this one:

Note that we are using @Max, a Hibernate Validator constraint, on our property level:

@Id @Max(2)  
private int level;

Therefore, when the user tries to save the driving lincence @Max constraint will be enforced, and the validation message will be shown to the user if it fails.

What's new in 3.0.1?

  • Hibernate Validator full support. Messages thrown by Hibernate Validator are shown to the user as validation messages.
  • @Required, @PropertyValidator and @EntityValidator redefined as Hibernate Validator constraints.
  • Max size of textAreaEditor uses Javascript for control max size (even with Ctrl-V).
  • Action 'new' of CRUD put the view to the initial section.
  • Ant creation wizard on template projects asks for the project name. Now it's not needed edit the ant build files.
  • A lot of fixes. Look at changelog.

Learn more on OpenXava site.

Download this new version from SourceForge.



Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}