[hibernate-dev] ValidationMode

Hardy Ferentschik hardy at hibernate.org
Fri Feb 22 15:38:32 EST 2013


On 22 Jan 2013, at 9:17 PM, Steve Ebersole <steve at hibernate.org> wrote:

> Kind of.  What I mean is that the HEM integration code is allowing Set <ValidationMode>.  So our impl allows a value like "auto, ddl" or other combos.  I am not able to grok why we allow multiples.

I think this is a Hibernate specific "feature" to support also ddl generation. The idea is to say something like "callback,ddl" to enable validation and application of DDL constraints.
Emmanuel might know more. With JPA 2.1 and the DDL stuff part of the spec I would assume there are are other explicit options to enable/disable these features. 

> Also auto and callback are slightly different.  callback causes an error if no bv provider is available whereas auto then skips validation.

Hmm, seems wrong indeed, but maybe that's the difference in the end. Looking at "3.6.1.1 Enabling Automatic Validation" of the spec for the auto mode it is not explicitly mentioned 
that an exception should be thrown whereas for callback it is. Whether this is international or just badly written I don't know. Maybe something to clarify in the spec.
Don't we have someone in the JPA expert group ;-)

--Hardy


More information about the hibernate-dev mailing list