Validating business data is a must in almost all applications. So far the common approach had been to define these constraints at multiple Tier – Web , Business and Data. This results in duplicated and distributed validation logic.
Hibernate Validator is a annotations based framework that consolidates this logic in one place (JPA Entity Beans). It’s pretty useful for the standard and simple validations like ‘not null’, length checks. For complex validations you can define your own validators. Its not a standard yet but JSR 303:Bean Validation is in progress and this was something that was inspired by Validator framework.
It integrates pretty well with Hibernate (No surprises there!!) letting the constraints included in the generated DDLs. It also can be combined with other JPA providers but needs some special configurations.
Validations are executed automatically prior to data inserts/updates. You can also call them programmatically using the API and if you Seam then you get seamless integration with JSF. So in a nutshell, the same validation logic can be used in Web, Business and Data tiers.
Its a simple framework and deserves a look!