You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2011/03/20 16:00:30 UTC

[jira] Created: (OPENJPA-1963) bean-validation constraints should be used for generating ddl schemas

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

[jira] [Commented] (OPENJPA-1963) bean-validation constraints should be used for generating ddl schemas

Posted by "Gerhard Petracek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013599#comment-13013599 ] 

Gerhard Petracek commented on OPENJPA-1963:
-------------------------------------------

see hibernate annotations

regards,
gerhard

> 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

[jira] [Commented] (OPENJPA-1963) bean-validation constraints should be used for generating ddl schemas

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Commented] (OPENJPA-1963) bean-validation constraints should be used for generating ddl schemas

Posted by "Jeremy Bauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013625#comment-13013625 ] 

Jeremy Bauer commented on OPENJPA-1963:
---------------------------------------

This feature was included under "Ideas explored and not standardized" in an appendix of the JSR-303/Bean Validation specification and simply wasn't ready for prime time at the time the spec was published.  OpenJPA could have chosen to implement this feature, but at the risk of implementing a feature that most likely will be updated and possibly cause backward compatibility issues in a future version.  It was decided not to implement the feature for that reason.  My guess is that we'll see this feature become standardized (non-optional) and expanded upon in the next revisions of the Bean Validation and JPA specifications.

Side note - scanning for these annotations in OpenJPA would be fairly trivial.  Processing constraints defined in XML will be more difficult.  OpenJPA would need to either do all the same annotation + constraint XML processing as the Bean Validation provider or tie into whatever constraint metadata is supplied by the validation API to determine which constraints need to applied as mapping information.  If we considered adding this feature to a future version of OpenJPA 2.x.x (based on JPA 2.0 and BV 1.0), my preference would be to require users to specifically enable it via an option on the configuration and mapping tool.

> 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

[jira] [Commented] (OPENJPA-1963) bean-validation constraints should be used for generating ddl schemas

Posted by "Rick Curtis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13013580#comment-13013580 ] 

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

> other jpa2 implementations already support it.
Which providers already provide support?

Thanks,
Rick

> 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