[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6557) Add varargs to Restrictions.and(...) and Restrictions.or(...)

Lorber Sebastien (JIRA) noreply at atlassian.com
Mon Aug 8 09:55:02 EDT 2011


Add varargs to Restrictions.and(...) and Restrictions.or(...)
-------------------------------------------------------------

                 Key: HHH-6557
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6557
             Project: Hibernate Core
          Issue Type: Improvement
          Components: query-criteria
    Affects Versions: 4.0.0.Beta5
         Environment: any
            Reporter: Lorber Sebastien
            Priority: Trivial


Add varargs to Restrictions.and(c1,c2) and Restrictions.or(c1,c2)
This becomes more userfriendly to create a large list of AND / OR restrictions, without the pain or instantiating and filling a (con/dis)junction

Note that the old methods returning LogicalExpression (and not Criterion) should be kept for retrocompatibility.
As Java uses varargs in last resort in the case of an overload, callind and(c1,c2) will still call the old methods so it doesn't break the compatibility for people that uses the return type as a LogicalExpression and not a Criterion



Pull request on github:
https://github.com/slorber/hibernate-core/commit/7a6e3adb783c8e3f9fd00b6741089347161773f1

--
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