openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-1963) bean-validation constraints should be used for generating ddl schemas
Date Wed, 30 Mar 2011 19:34:05 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013608#comment-13013608
] 

Rick Curtis commented on OPENJPA-1963:
--------------------------------------

http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/additionalmodules.html#d0e20757
23.1.4. Database schema

Hibernate uses Bean Validation constraints to generate an accurate database schema:

    * @NotNull leads to a not null column (unless it conflicts with components or table inheritance)
    * @Size.max leads to a varchar(max) definition for Strings
    * @Min, @Max lead to column checks (like value <= max)
    * @Digits leads to the definition of precision and scale (ever wondered which is which?
It's easy now with @Digits :) )

These constraints can be declared directly on the entity properties or indirectly by using
constraint composition.

> bean-validation constraints should be used for generating ddl schemas
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-1963
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1963
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: validation
>    Affects Versions: 2.1.0
>            Reporter: Gerhard Petracek
>
> the bean-validation spec. contains:
> >Persistence Providers are encouraged to make use of Bean Validation constraint metadata
when generating DDL schemas.
> other jpa2 implementations already support it. it's a really useful feature and might
be a blocker for users who would like to use openjpa2.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message