This is an automated email from the ASF dual-hosted git repository. borinquenkid pushed a commit to branch 8.0.x-hibernate7-dev in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 3b830d07d02876b924b593064754af3892ccb915 Author: Walter Duque de Estrada <[email protected]> AuthorDate: Sun Mar 8 09:56:44 2026 -0500 hibernate7: raw fixes --- .../grails/orm/HibernateCriteriaBuilder.java | 30 +++++++++++----------- .../mapping/query/api/BuildableCriteria.java | 10 ++++---- .../datastore/mapping/query/api/Criteria.java | 24 ++++++++--------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/grails-data-hibernate7/core/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java b/grails-data-hibernate7/core/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java index 1464f753e5..99eba287aa 100644 --- a/grails-data-hibernate7/core/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java +++ b/grails-data-hibernate7/core/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java @@ -104,6 +104,7 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui private Class<?> targetClass; private CriteriaQuery<?> criteriaQuery; private boolean uniqueResult = false; + //TODO Transactional behaviour is currently not supported, but we need to track whether the criteria should participate in a transaction or not private boolean participate; @SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName") @@ -598,14 +599,13 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui * @return A Criterion instance */ @Override - public Criteria gtAll( - String propertyName, @SuppressWarnings("rawtypes") QueryableCriteria propertyValue) { + public Criteria gtAll(String propertyName, QueryableCriteria<?> propertyValue) { hibernateQuery.gtAll(propertyName, propertyValue); return this; } @Override - public Criteria gtSome(String propertyName, QueryableCriteria propertyValue) { + public Criteria gtSome(String propertyName, QueryableCriteria<?> propertyValue) { return this; } @@ -615,7 +615,7 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui } @Override - public Criteria geSome(String propertyName, QueryableCriteria propertyValue) { + public Criteria geSome(String propertyName, QueryableCriteria<?> propertyValue) { hibernateQuery.geSome(propertyName, propertyValue); return this; } @@ -626,7 +626,7 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui } @Override - public Criteria ltSome(String propertyName, QueryableCriteria propertyValue) { + public Criteria ltSome(String propertyName, QueryableCriteria<?> propertyValue) { hibernateQuery.ltSome(propertyName, propertyValue); return this; } @@ -637,7 +637,7 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui } @Override - public Criteria leSome(String propertyName, QueryableCriteria propertyValue) { + public Criteria leSome(String propertyName, QueryableCriteria<?> propertyValue) { hibernateQuery.leSome(propertyName, propertyValue); return this; } @@ -823,19 +823,19 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui } @Override - public Criteria and(Closure callable) { + public Criteria and(Closure<?> callable) { hibernateQuery.and(callable); return this; } @Override - public Criteria or(Closure callable) { + public Criteria or(Closure<?> callable) { hibernateQuery.or(callable); return this; } @Override - public Criteria not(Closure callable) { + public Criteria not(Closure<?> callable) { hibernateQuery.not(callable); return this; } @@ -1120,12 +1120,12 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui } @Override - public Object list(@DelegatesTo(Criteria.class) Closure c) { + public Object list(@DelegatesTo(Criteria.class) Closure<?> c) { hibernateQuery.setDetachedCriteria(new DetachedCriteria<>(targetClass)); return invokeMethod(CriteriaMethods.LIST_CALL.getName(), new Object[] {c}); } - public List list() { + public List<?> list() { return hibernateQuery.list(); } @@ -1134,23 +1134,23 @@ public class HibernateCriteriaBuilder extends GroovyObjectSupport implements Bui } @Override - public Object list(Map params, @DelegatesTo(Criteria.class) Closure c) { + public Object list(Map<String,?> params, @DelegatesTo(Criteria.class) Closure<?> c) { hibernateQuery.setDetachedCriteria(new DetachedCriteria<>(targetClass)); return invokeMethod(CriteriaMethods.LIST_CALL.getName(), new Object[] {params, c}); } @Override - public Object listDistinct(@DelegatesTo(Criteria.class) Closure c) { + public Object listDistinct(@DelegatesTo(Criteria.class) Closure<?> c) { return invokeMethod(CriteriaMethods.LIST_DISTINCT_CALL.getName(), new Object[] {c}); } @Override - public Object get(@DelegatesTo(Criteria.class) Closure c) { + public Object get(@DelegatesTo(Criteria.class) Closure<?> c) { return invokeMethod(CriteriaMethods.GET_CALL.getName(), new Object[] {c}); } @Override - public Object scroll(@DelegatesTo(Criteria.class) Closure c) { + public Object scroll(@DelegatesTo(Criteria.class) Closure<?> c) { return invokeMethod(CriteriaMethods.SCROLL_CALL.getName(), new Object[] {c}); } diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/BuildableCriteria.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/BuildableCriteria.java index b279ebb76d..4e97503529 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/BuildableCriteria.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/BuildableCriteria.java @@ -85,7 +85,7 @@ public interface BuildableCriteria extends Criteria { * * @return The result */ - Object list(@DelegatesTo(Criteria.class) Closure closure); + Object list(@DelegatesTo(Criteria.class) Closure<?> closure); /** * Defines and executes a list query in a single call. Example: Foo.createCriteria().list { } @@ -95,7 +95,7 @@ public interface BuildableCriteria extends Criteria { * * @return The result */ - Object list(Map params, @DelegatesTo(Criteria.class) Closure closure); + Object list(Map<String,?> params, @DelegatesTo(Criteria.class) Closure<?> closure); /** * Defines and executes a list distinct query in a single call. Example: Foo.createCriteria().listDistinct { } @@ -103,7 +103,7 @@ public interface BuildableCriteria extends Criteria { * * @return The result */ - Object listDistinct(@DelegatesTo(Criteria.class) Closure closure); + Object listDistinct(@DelegatesTo(Criteria.class) Closure<?> closure); /** * Defines and executes a scroll query in a single call. Example: Foo.createCriteria().scroll { } @@ -112,7 +112,7 @@ public interface BuildableCriteria extends Criteria { * * @return A scrollable result set */ - Object scroll(@DelegatesTo(Criteria.class) Closure closure); + Object scroll(@DelegatesTo(Criteria.class) Closure<?> closure); /** * Defines and executes a get query ( a single result) in a single call. Example: Foo.createCriteria().get { } @@ -121,5 +121,5 @@ public interface BuildableCriteria extends Criteria { * * @return A single result */ - Object get(@DelegatesTo(Criteria.class) Closure closure); + Object get(@DelegatesTo(Criteria.class) Closure<?> closure); } diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/Criteria.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/Criteria.java index 14df94f6b0..51483e7ae8 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/Criteria.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/query/api/Criteria.java @@ -214,21 +214,21 @@ public interface Criteria { * * @return This criteria */ - Criteria and(@DelegatesTo(Criteria.class) Closure callable); + Criteria and(@DelegatesTo(Criteria.class) Closure<?> callable); /** * Creates a logical disjunction * @param callable The closure * @return This criteria */ - Criteria or(@DelegatesTo(Criteria.class) Closure callable); + Criteria or(@DelegatesTo(Criteria.class) Closure<?> callable); /** * Creates a logical negation * @param callable The closure * @return This criteria */ - Criteria not(@DelegatesTo(Criteria.class) Closure callable); + Criteria not(@DelegatesTo(Criteria.class) Closure<?> callable); /** * Creates an "in" Criterion based on the specified property name and list of values @@ -536,7 +536,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria eqAll(String propertyName, QueryableCriteria propertyValue); + Criteria eqAll(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is greater than all the given returned values @@ -546,7 +546,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria gtAll(String propertyName, QueryableCriteria propertyValue); + Criteria gtAll(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is less than all the given returned values @@ -556,7 +556,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria ltAll(String propertyName, QueryableCriteria propertyValue); + Criteria ltAll(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is greater than all the given returned values @@ -566,7 +566,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria geAll(String propertyName, QueryableCriteria propertyValue); + Criteria geAll(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is less than all the given returned values @@ -576,7 +576,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria leAll(String propertyName, QueryableCriteria propertyValue); + Criteria leAll(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is greater than some of the given values @@ -586,7 +586,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria gtSome(String propertyName, QueryableCriteria propertyValue); + Criteria gtSome(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is greater than some of the given values @@ -606,7 +606,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria geSome(String propertyName, QueryableCriteria propertyValue); + Criteria geSome(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is greater than or equal to some of the given values @@ -626,7 +626,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria ltSome(String propertyName, QueryableCriteria propertyValue); + Criteria ltSome(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is less than some of the given values @@ -646,7 +646,7 @@ public interface Criteria { * * @return This Criteria instance */ - Criteria leSome(String propertyName, QueryableCriteria propertyValue); + Criteria leSome(String propertyName, QueryableCriteria<?> propertyValue); /** * Creates a subquery criterion that ensures the given property is less than or equal to some of the given values
