]
David J. M. Karlsen commented on HV-516:
----------------------------------------
True, my description is probably more describing and current and based on 4.2.0.Final
Hibernate Validator doesn't work well with hibernate persistence
when generating DDL
------------------------------------------------------------------------------------
Key: HV-516
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HV-516
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.2.0.Final
Environment: java6, hibernate 3.6.7
Reporter: David J. M. Karlsen
Assignee: Hardy Ferentschik
Priority: Critical
According to
http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/...
validation annotations should influence the DDL generation. This is not the case.
If I have the following field declaration:
{noformat}
@Length( max=10 )
private String test;
{noformat}
it will generate the standard 255:
{noformat}
test varchar2(255 char),
{noformat}
It appears to be an *ancient* bug - dating back from 2007:
From
https://forum.hibernate.org/viewtopic.php?t=975612
I do have
{noformat}
<property name="javax.persistence.validation.mode" value="callback,
ddl" />
{noformat}
in my persistence.xml configuration.
It's needless to say how irritating it is to define the constraints several times for
each attribute.
Any chance of getting this fixed (or correct the faulty documentation)?
It's not a blocker since it's possible to define the constraints twice - once for
hibernate persistence - and once for validation - but it is very very inefficient - and
can lead to inconsistencies.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: