just my notes...

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

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
Etiquetas: hibernate validation groups object references

No hay comentarios:

Publicar un comentario

Entrada más reciente Entrada antigua Inicio
Suscribirse a: Enviar comentarios (Atom)

Archivo del blog

  • ►  2013 (15)
    • ►  noviembre (11)
    • ►  octubre (4)
  • ▼  2010 (24)
    • ►  agosto (1)
    • ►  mayo (10)
    • ▼  abril (7)
      • ant tasks in maven
      • SeamTest and Maven
      • para probar Arquilian en hermes
      • TestNG
      • Arquilian
      • Para lo de unique numeroOrden-turno
      • hermes: validating properties referencing another ...
    • ►  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.