HHH-9791 - Add varargs to Restrictions.in(...)

This commit is contained in:
Steve Ebersole 2015-10-06 16:24:56 -05:00
parent 0cf66b85e0
commit ca171b112c
5 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ public class InExpression implements Criterion {
* @param values The values to check against
*
* @see Restrictions#in(String, java.util.Collection)
* @see Restrictions#in(String, Object[])
* @see Restrictions#in(String, Object...)
*/
protected InExpression(String propertyName, Object[] values) {
this.propertyName = propertyName;

View File

@ -71,7 +71,7 @@ public class Property extends PropertyProjection {
*
* @see Restrictions#in(String, Object[])
*/
public Criterion in(Object[] values) {
public Criterion in(Object... values) {
return Restrictions.in( getPropertyName(), values );
}

View File

@ -246,7 +246,7 @@ public class Restrictions {
*
* @see InExpression
*/
public static Criterion in(String propertyName, Object[] values) {
public static Criterion in(String propertyName, Object... values) {
return new InExpression( propertyName, values );
}

View File

@ -100,7 +100,7 @@ public class JoinedSubclassTest extends BaseCoreFunctionalTestCase {
assertEquals( s.createQuery("from Person p where p.address.zip = '30306'" ).list().size(),1 );
s.createCriteria( Person.class ).add(
Restrictions.in( "address", new Address[] { mark.getAddress(), joe.getAddress() } ) ).list();
Restrictions.in( "address", mark.getAddress(), joe.getAddress() ) ).list();
s.delete(mark);
s.delete(joe);

View File

@ -1936,7 +1936,7 @@ public class FooBarTest extends LegacyTestCase {
.add( Restrictions.eq( "integer", f.getInteger() ) )
.add( Restrictions.eqProperty("integer", "integer") )
.add( Restrictions.like( "string", f.getString().toUpperCase(Locale.ROOT) ).ignoreCase() )
.add( Restrictions.in( "boolean", new Boolean[] { f.getBoolean(), f.getBoolean() } ) )
.add( Restrictions.in( "boolean", f.getBoolean(), f.getBoolean() ) )
.setFetchMode("foo", FetchMode.JOIN)
.setFetchMode("baz", FetchMode.SELECT)
.setFetchMode("abstracts", FetchMode.JOIN)
@ -2023,7 +2023,7 @@ public class FooBarTest extends LegacyTestCase {
list = s.createCriteria(Foo.class)
.add( Restrictions.eq( "integer", f.getInteger() ) )
.add( Restrictions.like( "string", f.getString() ) )
.add( Restrictions.in( "boolean", new Boolean[] { f.getBoolean(), f.getBoolean() } ) )
.add( Restrictions.in( "boolean", f.getBoolean(), f.getBoolean() ) )
.add( Restrictions.isNotNull("foo") )
.setFetchMode( "foo", FetchMode.JOIN )
.setFetchMode( "baz", FetchMode.SELECT )