Yeah it work, there are two options of usage so far

1. You put in the type, works fine too, but the problem is it will be
called two times, one for the @Valid in the controller action and the
second when it going to be persisted

2. You put along with the @Valid in the controller action, so it will be
called only one time.


2014-02-12 23:48 GMT-03:00 Paulo A Junior <notifications@github.com>:

> In src/main/java/org/cejug/hurraa/controller/EquipmentModelController.java:
>
> > @@ -75,12 +79,15 @@ public void form(Long id) {
> >      }
> >
> >      @Post("insert")
> > -    public void insert(@Valid  EquipmentModel equipmentModel
> > -            , Validator validator ) {
> > +    public void insert(@Valid
> > +            @Unique(propertyName = "name" , identityPropertyName="id" , entityClass =EquipmentModel.class )
>
> @Unique it's not be better to put at the class attribute? Or it don't
> work in a class attribute?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/cejug/hurraa/pull/71/files#r9696172>
> .
>



-- 
Atenciosamente,
Efraim Gentil - @efraimgentil <https://twitter.com/efraimgentil>
Github: efriamgentil <https://github.com/efraimgentil>