From c4eff66948df797a10bfa33c035dcf9133dd52c2 Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Thu, 28 Feb 2013 15:41:50 -0500 Subject: [PATCH] HHH-8025 Revert "HHH-2951 Restrictions.eq when passed null, should create a NullRestriction" This reverts commit 265b3d37cfa838a5509493b9023fd8e396e23544. --- .../main/java/org/hibernate/criterion/Property.java | 4 ++-- .../java/org/hibernate/criterion/Restrictions.java | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/Property.java b/hibernate-core/src/main/java/org/hibernate/criterion/Property.java index 42ad8eabcd..d988d6cc03 100755 --- a/hibernate-core/src/main/java/org/hibernate/criterion/Property.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/Property.java @@ -55,11 +55,11 @@ public class Property extends PropertyProjection { return Restrictions.like(getPropertyName(), value, matchMode); } - public Criterion eq(Object value) { + public SimpleExpression eq(Object value) { return Restrictions.eq(getPropertyName(), value); } - public Criterion ne(Object value) { + public SimpleExpression ne(Object value) { return Restrictions.ne(getPropertyName(), value); } diff --git a/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java b/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java index d39acadcdd..6c0ee654f5 100755 --- a/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java +++ b/hibernate-core/src/main/java/org/hibernate/criterion/Restrictions.java @@ -61,10 +61,7 @@ public class Restrictions { * @param value * @return Criterion */ - public static Criterion eq(String propertyName, Object value) { - if (null == value) { - return isNull(propertyName); - } + public static SimpleExpression eq(String propertyName, Object value) { return new SimpleExpression(propertyName, value, "="); } /** @@ -73,10 +70,7 @@ public class Restrictions { * @param value * @return Criterion */ - public static Criterion ne(String propertyName, Object value) { - if (null == value) { - return isNotNull(propertyName); - } + public static SimpleExpression ne(String propertyName, Object value) { return new SimpleExpression(propertyName, value, "<>"); } /**