[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-232) Support Method-Level constraint declaration

Emmanuel Bernard (JIRA) noreply at atlassian.com
Mon Jul 11 12:35:17 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/BVAL-232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42939#comment-42939 ] 

Emmanuel Bernard commented on BVAL-232:
---------------------------------------

I like 2b but... I don't think Java can properly model this in a type-safe way. I know Ceylon can but afaik that's the only language that can.
In other words nothing will prevent someone from writing the wrong signature.
1. can be built atop 2.a. And regardless, I think we should offer 2.a.

I guess what we could do is have the interface be 2.a. and allow other isValid methods (a la 2.b) and call them upon matching. Not sure I like that but that should be explored.

> Support Method-Level constraint declaration
> -------------------------------------------
>
>                 Key: BVAL-232
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-232
>             Project: Bean Validation
>          Issue Type: New Feature
>          Components: spec-general
>            Reporter: Emmanuel Bernard
>             Fix For: 1.1
>
>
> Do you think we should support the following?
> {code}@DateInOrder
> void bookHotel(@NotNull @Valid Customer customer, Date from, Date to);{code}
> ie like we have properly level and class level constraints, we could get method level constraints receiving all the parameters and raising constraints violations if necessary.

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

        


More information about the hibernate-issues mailing list