myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Shakov <alexey.sha...@menta.de>
Subject Re: Apache ExtVal: Annotation "@BeanValidation(useGroups = SkipValidation.class)" has no effect for properties, annotated with @Column
Date Mon, 11 Nov 2013 15:12:57 GMT
Hi Gerhard,

thank you for a quick answer.

I thought, that from JSF-Validation perspective following two notations 
must be the same:

#1:

@Column(name="NAME", length=80, nullable=false)
private String name;

#2

@NotNull
@Size (max=80)
private String name;


It is still not clear for me, why they are differently handled by 
@BeanValidation(useGroups = SkipValidation.class)

Regards,
Alexey

Am 11.11.2013 15:12, schrieb Gerhard Petracek:
> hi alexey,
>
> there are 2 different validation-modules:
> #1 property-validation (= extval-constraints + jpa-based validation)
> #2 bean-validation (= better jsf-integration of bv)
>
> they follow different concepts -> with @BeanValidation (provided by #2) you
> can't control jpa-based validation (provided by #1).
> further details are available at [1].
>
> regards,
> gerhard
>
> [1] http://s.apache.org/EXTVAL_Chapter
>
> http://www.irian.at
>
> Your JSF/JavaEE powerhouse -
> JavaEE Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
>
>
> 2013/11/11 Alexey Shakov <alexey.shakov@menta.de>
>
>> Hi *,
>>
>> I use Annotation "@BeanValidation(useGroups = SkipValidation.class)" on my
>> action method to ignore the validation constraints, if it getting called
>> from JSF-facelet.
>>
>> I've noticed, that this annotation works good for "standalone"
>> constraints, such as @NotNull or @Size, but not for @Column.
>> In my case, I have a Hibernate-Entity with a name-property, annotated like
>> this:
>>
>> @Column(name="NAME", length=80, nullable=false)
>> private String name;
>>
>> This property is getting always validated (length and not-null check),
>> regardless of "@BeanValidation(useGroups = SkipValidation.class)"-annotation
>> on corresponding action method.
>>
>> What is a reason for this behavior? Did I misunderstand something?
>>
>> (I use MyFaces 2.1.13, MyFaces extval 2.0.7, hibernate-validator
>> 5.0.1.Final)
>>
>> Thanks for any help,
>>
>> Alexey
>>


Mime
View raw message