HHH-11584 - Made parameter names of Restrictions#between more readable
This commit is contained in:
parent
d1dc9146c3
commit
c8cbb8f0c6
|
@ -18,13 +18,13 @@ import org.hibernate.internal.util.StringHelper;
|
||||||
*/
|
*/
|
||||||
public class BetweenExpression implements Criterion {
|
public class BetweenExpression implements Criterion {
|
||||||
private final String propertyName;
|
private final String propertyName;
|
||||||
private final Object lo;
|
private final Object low;
|
||||||
private final Object hi;
|
private final Object high;
|
||||||
|
|
||||||
protected BetweenExpression(String propertyName, Object lo, Object hi) {
|
protected BetweenExpression(String propertyName, Object low, Object high) {
|
||||||
this.propertyName = propertyName;
|
this.propertyName = propertyName;
|
||||||
this.lo = lo;
|
this.low = low;
|
||||||
this.hi = hi;
|
this.high = high;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,14 +37,14 @@ public class BetweenExpression implements Criterion {
|
||||||
@Override
|
@Override
|
||||||
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
|
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
|
||||||
return new TypedValue[] {
|
return new TypedValue[] {
|
||||||
criteriaQuery.getTypedValue( criteria, propertyName, lo ),
|
criteriaQuery.getTypedValue( criteria, propertyName, low),
|
||||||
criteriaQuery.getTypedValue( criteria, propertyName, hi )
|
criteriaQuery.getTypedValue( criteria, propertyName, high)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return propertyName + " between " + lo + " and " + hi;
|
return propertyName + " between " + low + " and " + high;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,15 +225,15 @@ public class Restrictions {
|
||||||
* Apply a "between" constraint to the named property
|
* Apply a "between" constraint to the named property
|
||||||
*
|
*
|
||||||
* @param propertyName The name of the property
|
* @param propertyName The name of the property
|
||||||
* @param lo The low value
|
* @param low The low value
|
||||||
* @param hi The high value
|
* @param high The high value
|
||||||
*
|
*
|
||||||
* @return The Criterion
|
* @return The Criterion
|
||||||
*
|
*
|
||||||
* @see BetweenExpression
|
* @see BetweenExpression
|
||||||
*/
|
*/
|
||||||
public static Criterion between(String propertyName, Object lo, Object hi) {
|
public static Criterion between(String propertyName, Object low, Object high) {
|
||||||
return new BetweenExpression( propertyName, lo, hi );
|
return new BetweenExpression( propertyName, low, high );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue