Ok, I found part of the problem. Validator is creating column-level
check constraints (Column.setCheckConstraint). However those are
ignored if the dialect reports that it does not "supportsColumnCheck".
HSQLDialect happens to be one such dialect.
Seems to me though that TheRightThing to do there is to add them as
table-level check constraints, if the dialect additionally says that it
"supportsTableCheck". Anyway, thats not what it does today.
When I first looked at the test I saw "ConstraintViolationException" and
thought "org.hibernate.exception.ConstraintViolationException" (which is
what is happening on h2 and most every other db out there i assume), but
it is actually checking "javax.validation.ConstraintViolationException".
On Fri, 2010-05-21 at 11:09 -0500, Steve Ebersole wrote:
In trying to switch over to h2,
org.hibernate.test.annotations.beanvalidation.DDLWithoutCallbackTest is
failing when run against h2 whereas it passes with hsqldb.
The difference is that when run against hsqldb no check constraint is
defined when the table is created. But the check constraint is defined
when the table is created on h2.
The test does say :
cfg.setProperty( "javax.persistence.validation.mode", "ddl" );
Isn't the point of this to generate the check constraints in the
database? Basically isn't this test just defined to pass on hsqldb and
fall on others?
--
Steve Ebersole <steve(a)hibernate.org>
http://hibernate.org