HHH-2951 Restrictions.eq when passed null, should create a NullRestriction
This commit is contained in:
parent
991342f2c2
commit
70454c9168
|
@ -55,11 +55,11 @@ public class Property extends PropertyProjection {
|
|||
return Restrictions.like(getPropertyName(), value, matchMode);
|
||||
}
|
||||
|
||||
public SimpleExpression eq(Object value) {
|
||||
public Criterion eq(Object value) {
|
||||
return Restrictions.eq(getPropertyName(), value);
|
||||
}
|
||||
|
||||
public SimpleExpression ne(Object value) {
|
||||
public Criterion ne(Object value) {
|
||||
return Restrictions.ne(getPropertyName(), value);
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,10 @@ public class Restrictions {
|
|||
* @param value
|
||||
* @return Criterion
|
||||
*/
|
||||
public static SimpleExpression eq(String propertyName, Object value) {
|
||||
public static Criterion eq(String propertyName, Object value) {
|
||||
if (null == value) {
|
||||
return isNull(propertyName);
|
||||
}
|
||||
return new SimpleExpression(propertyName, value, "=");
|
||||
}
|
||||
/**
|
||||
|
@ -70,7 +73,10 @@ public class Restrictions {
|
|||
* @param value
|
||||
* @return Criterion
|
||||
*/
|
||||
public static SimpleExpression ne(String propertyName, Object value) {
|
||||
public static Criterion ne(String propertyName, Object value) {
|
||||
if (null == value) {
|
||||
return isNotNull(propertyName);
|
||||
}
|
||||
return new SimpleExpression(propertyName, value, "<>");
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue