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 {
|
||||
private final String propertyName;
|
||||
private final Object lo;
|
||||
private final Object hi;
|
||||
private final Object low;
|
||||
private final Object high;
|
||||
|
||||
protected BetweenExpression(String propertyName, Object lo, Object hi) {
|
||||
protected BetweenExpression(String propertyName, Object low, Object high) {
|
||||
this.propertyName = propertyName;
|
||||
this.lo = lo;
|
||||
this.hi = hi;
|
||||
this.low = low;
|
||||
this.high = high;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,14 +37,14 @@ public class BetweenExpression implements Criterion {
|
|||
@Override
|
||||
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
|
||||
return new TypedValue[] {
|
||||
criteriaQuery.getTypedValue( criteria, propertyName, lo ),
|
||||
criteriaQuery.getTypedValue( criteria, propertyName, hi )
|
||||
criteriaQuery.getTypedValue( criteria, propertyName, low),
|
||||
criteriaQuery.getTypedValue( criteria, propertyName, high)
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
*
|
||||
* @param propertyName The name of the property
|
||||
* @param lo The low value
|
||||
* @param hi The high value
|
||||
* @param low The low value
|
||||
* @param high The high value
|
||||
*
|
||||
* @return The Criterion
|
||||
*
|
||||
* @see BetweenExpression
|
||||
*/
|
||||
public static Criterion between(String propertyName, Object lo, Object hi) {
|
||||
return new BetweenExpression( propertyName, lo, hi );
|
||||
public static Criterion between(String propertyName, Object low, Object high) {
|
||||
return new BetweenExpression( propertyName, low, high );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue