just my notes...

blog to recollect different kinf of data, comments, todo's, and make it easily avalaible from the web

Mostrando entradas con la etiqueta hibernate validation groups object references. Mostrar todas las entradas
Mostrando entradas con la etiqueta hibernate validation groups object references. Mostrar todas las entradas

01 abril 2010

hermes: validating properties referencing another object

2.1.5. Object graphs

The Bean Validation API does not only allow to validate single class instances but also complete object graphs. To do so, just annotate a field or property representing a reference to another object with @Valid. If the parent object is validated, all referenced objects annotated with @Valid will be validated as well (as will be their children etc.)

2.3. Validating groups

Groups allow you to restrict the set of constraints applied during validation. This makes for example wizard like validation possible where in each step only a specified subset of constraints get validated. The groups targeted are passed as var-args parameters to validate, validateProperty and validateValue. Let's have a look at an extended Car with Driver example. First we have the class Person (Example 2.12, “Person”) which has a @NotNull constraint on name. Since no group is specified for this annotation its default group is javax.validation.groups.Default.


Publicado por Unknown en 0:28 No hay comentarios:
Etiquetas: hibernate validation groups object references
Entradas antiguas Inicio
Suscribirse a: Entradas (Atom)

Archivo del blog

  • ▼  2013 (15)
    • ▼  noviembre (11)
      • Real User Monitoring
      • provider org.hibernate.ejb.HibernatePersistence pr...
      • If you are not laughing at yourself, then you jus...
      • Enterprise Java Programming with IBM WebSphere ...
      • org.hibernate.transaction Class WebSphereExtende...
      • Nagios With Nagios you can: Monitor your entire...
      • Compuware APM Application Monitoring http://www....
      • Setting the Transaction Timeout on WebSphere W...
      • Performance Monitoring Infrastructure (PMI) h...
      • Mkyong
      • Top 8 Java People You Should Know http://www.mkyon...
    • ►  octubre (4)
  • ►  2010 (24)
    • ►  agosto (1)
    • ►  mayo (10)
    • ►  abril (7)
    • ►  marzo (6)
  • ►  2009 (127)
    • ►  diciembre (12)
    • ►  noviembre (9)
    • ►  octubre (10)
    • ►  septiembre (6)
    • ►  julio (3)
    • ►  junio (1)
    • ►  mayo (6)
    • ►  abril (16)
    • ►  marzo (15)
    • ►  febrero (23)
    • ►  enero (26)
  • ►  2008 (125)
    • ►  diciembre (65)
    • ►  noviembre (23)
    • ►  octubre (30)
    • ►  junio (1)
    • ►  mayo (3)
    • ►  marzo (3)

Datos personales

Unknown
Ver todo mi perfil
Tema Sencillo. Con la tecnología de Blogger.