borinquenkid commented on code in PR #15568:
URL: https://github.com/apache/grails-core/pull/15568#discussion_r3440093207


##########
grails-test-examples/gorm/src/integration-test/groovy/gorm/TransactionPropagationSpec.groovy:
##########
@@ -44,8 +44,8 @@ class TransactionPropagationSpec extends Specification {
     def setup() {
         // Clean up before each test - delete books first due to FK constraint
         Author.withNewTransaction {
-            Book.executeUpdate('delete from Book')
-            Author.executeUpdate('delete from Author')
+            Book.executeUpdate('delete from Book', [:])

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-test-examples/gorm/src/integration-test/groovy/gorm/TransactionalWhereQueryVariableScopeSpec.groovy:
##########
@@ -45,8 +45,8 @@ class TransactionalWhereQueryVariableScopeSpec extends 
Specification {
     WhereQueryVariableScopeService whereQueryVariableScopeService
 
     def setup() {
-        Book.executeUpdate('delete from Book')
-        Author.executeUpdate('delete from Author')
+        Book.executeUpdate('delete from Book', [:])

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-test-examples/gorm/src/integration-test/groovy/gorm/GormWhereQueryAdvancedSpec.groovy:
##########
@@ -39,8 +39,8 @@ class GormWhereQueryAdvancedSpec extends Specification {
 
     def setup() {
         // Clean up existing data
-        Book.executeUpdate('delete from Book')
-        Author.executeUpdate('delete from Author')
+        Book.executeUpdate('delete from Book', [:])

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-test-examples/gorm/src/integration-test/groovy/gorm/GormEventsSpec.groovy:
##########
@@ -42,7 +42,7 @@ import grails.testing.mixin.integration.Integration
 class GormEventsSpec extends Specification {
 
     def setup() {
-        AuditedEntity.executeUpdate('delete from AuditedEntity')
+        AuditedEntity.executeUpdate('delete from AuditedEntity', [:])

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-test-examples/gorm/src/integration-test/groovy/gorm/GormCriteriaQueriesSpec.groovy:
##########
@@ -24,21 +24,20 @@ import spock.lang.Unroll
 import grails.gorm.DetachedCriteria
 import grails.gorm.transactions.Rollback
 import grails.testing.mixin.integration.Integration
-
 /**
  * Tests for GORM Criteria Queries - both createCriteria() and 
DetachedCriteria.
  *
  * Criteria queries provide a type-safe, programmatic way to build
  * complex queries without writing HQL strings.
  */
 @Rollback
-@Integration
+@Integration(applicationClass = Application)
 class GormCriteriaQueriesSpec extends Specification {
 
     def setup() {
         // Clean up and create fresh test data
-        Book.executeUpdate('delete from Book')
-        Author.executeUpdate('delete from Author')
+        Book.executeUpdate('delete from Book', [:])

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-test-examples/gorm/src/integration-test/groovy/gorm/GormDataServicesSpec.groovy:
##########
@@ -48,8 +48,8 @@ class GormDataServicesSpec extends Specification {
 
     def setup() {
         // Clean up and create fresh test data
-        Book.executeUpdate('delete from Book')
-        Author.executeUpdate('delete from Author')
+        Book.executeUpdate('delete from Book', [:])

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java:
##########
@@ -422,30 +420,6 @@ public static Object unwrapIfProxy(Object instance) {
         return proxyHandler.unwrap(instance);
     }
 
-    /**
-     * @deprecated Use {@link  
MultipleDataSourceSupport#getDefaultDataSource(PersistentEntity)} instead
-     */
-    @Deprecated
-    public static String getDefaultDataSource(PersistentEntity domainClass) {
-        return MultipleDataSourceSupport.getDefaultDataSource(domainClass);
-    }
-
-    /**
-     * @deprecated Use {@link  
MultipleDataSourceSupport#getDatasourceNames(PersistentEntity)} instead
-     */
-    @Deprecated
-    public static List<String> getDatasourceNames(PersistentEntity 
domainClass) {
-        return MultipleDataSourceSupport.getDatasourceNames(domainClass);
-    }
-
-    /**
-     * @deprecated Use {@link  
MultipleDataSourceSupport#getDefaultDataSource(PersistentEntity)} instead
-     */
-    @Deprecated
-    public static boolean usesDatasource(PersistentEntity domainClass, String 
dataSourceName) {
-        return MultipleDataSourceSupport.usesDatasource(domainClass, 
dataSourceName);
-    }
-

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java:
##########
@@ -62,256 +55,80 @@
  * @since 0.4
  */
 public class GrailsHibernateUtil extends HibernateRuntimeUtils {
-    protected static final Logger LOG = 
LoggerFactory.getLogger(GrailsHibernateUtil.class);
-
-    public static final String ARGUMENT_FETCH_SIZE = "fetchSize";
-    public static final String ARGUMENT_TIMEOUT = "timeout";
-    public static final String ARGUMENT_READ_ONLY = "readOnly";
-    public static final String ARGUMENT_FLUSH_MODE = "flushMode";
-    public static final String ARGUMENT_MAX = "max";
-    public static final String ARGUMENT_OFFSET = "offset";
-    public static final String ARGUMENT_ORDER = "order";
-    public static final String ARGUMENT_SORT = "sort";
-    public static final String ORDER_DESC = "desc";
-    public static final String ORDER_ASC = "asc";
-    public static final String ARGUMENT_FETCH = "fetch";
-    public static final String ARGUMENT_IGNORE_CASE = "ignoreCase";
-    public static final String ARGUMENT_CACHE = "cache";
-    public static final String ARGUMENT_LOCK = "lock";
-    public static final Class<?>[] EMPTY_CLASS_ARRAY = {};
-
-    private static HibernateProxyHandler proxyHandler = new 
HibernateProxyHandler();
-
-    public static void populateArgumentsForCriteria(AbstractHibernateDatastore 
datastore, Class<?> targetClass, Criteria c, Map argMap, ConversionService 
conversionService) {
-        populateArgumentsForCriteria(datastore, targetClass, c, argMap, 
conversionService, true);
-    }
-
-    /**
-     * Populates criteria arguments for the given target class and arguments 
map
-     *
-     * @param datastore the GrailsApplication instance
-     * @param targetClass The target class
-     * @param c The criteria instance
-     * @param argMap The arguments map
-     */
-    @SuppressWarnings("rawtypes")
-    public static void populateArgumentsForCriteria(AbstractHibernateDatastore 
datastore, Class<?> targetClass, Criteria c, Map argMap, ConversionService 
conversionService, boolean useDefaultMapping) {
-        Integer maxParam = null;
-        Integer offsetParam = null;
-        if (argMap.containsKey(ARGUMENT_MAX)) {
-            maxParam = conversionService.convert(argMap.get(ARGUMENT_MAX), 
Integer.class);
-        }
-        if (argMap.containsKey(ARGUMENT_OFFSET)) {
-            offsetParam = 
conversionService.convert(argMap.get(ARGUMENT_OFFSET), Integer.class);
-        }
-        if (argMap.containsKey(ARGUMENT_FETCH_SIZE)) {
-            
c.setFetchSize(conversionService.convert(argMap.get(ARGUMENT_FETCH_SIZE), 
Integer.class));
-        }
-        if (argMap.containsKey(ARGUMENT_TIMEOUT)) {
-            
c.setTimeout(conversionService.convert(argMap.get(ARGUMENT_TIMEOUT), 
Integer.class));
-        }
-        if (argMap.containsKey(ARGUMENT_FLUSH_MODE)) {
-            c.setFlushMode(convertFlushMode(argMap.get(ARGUMENT_FLUSH_MODE)));
-        }
-        if (argMap.containsKey(ARGUMENT_READ_ONLY)) {
-            c.setReadOnly(ClassUtils.getBooleanFromMap(ARGUMENT_READ_ONLY, 
argMap));
-        }
-        String orderParam = (String) argMap.get(ARGUMENT_ORDER);
-        Object fetchObj = argMap.get(ARGUMENT_FETCH);
-        if (fetchObj instanceof Map) {
-            Map fetch = (Map) fetchObj;
-            for (Object o : fetch.keySet()) {
-                String associationName = (String) o;
-                c.setFetchMode(associationName, 
getFetchMode(fetch.get(associationName)));
-            }
-        }
-
-        final int max = maxParam == null ? -1 : maxParam;
-        final int offset = offsetParam == null ? -1 : offsetParam;
-        if (max > -1) {
-            c.setMaxResults(max);
-        }
-        if (offset > -1) {
-            c.setFirstResult(offset);
-        }
-        if (ClassUtils.getBooleanFromMap(ARGUMENT_LOCK, argMap)) {
-            c.setLockMode(LockMode.PESSIMISTIC_WRITE);
-            c.setCacheable(false);
-        }
-        else {
-            if (argMap.containsKey(ARGUMENT_CACHE)) {
-                c.setCacheable(ClassUtils.getBooleanFromMap(ARGUMENT_CACHE, 
argMap));
-            } else {
-                cacheCriteriaByMapping(targetClass, c);
-            }
-        }
-
-        final Object sortObj = argMap.get(ARGUMENT_SORT);
-        if (sortObj != null) {
-            boolean ignoreCase = true;
-            Object caseArg = argMap.get(ARGUMENT_IGNORE_CASE);
-            if (caseArg instanceof Boolean) {
-                ignoreCase = (Boolean) caseArg;
-            }
-            if (sortObj instanceof Map) {
-                Map sortMap = (Map) sortObj;
-                for (Object sort : sortMap.keySet()) {
-                    final String order = ORDER_DESC.equalsIgnoreCase((String) 
sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
-                    addOrderPossiblyNested(datastore, c, targetClass, (String) 
sort, order, ignoreCase);
-                }
-            } else {
-                final String sort = (String) sortObj;
-                final String order = ORDER_DESC.equalsIgnoreCase(orderParam) ? 
ORDER_DESC : ORDER_ASC;
-                addOrderPossiblyNested(datastore, c, targetClass, sort, order, 
ignoreCase);
-            }
-        }
-        else if (useDefaultMapping) {
-            Mapping m = GrailsDomainBinder.getMapping(targetClass);
-            if (m != null) {
-                Map sortMap = m.getSort().getNamesAndDirections();
-                for (Object sort : sortMap.keySet()) {
-                    final String order = ORDER_DESC.equalsIgnoreCase((String) 
sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
-                    addOrderPossiblyNested(datastore, c, targetClass, (String) 
sort, order, true);
-                }
-            }
-        }
-    }
-
-    /**
-     * @deprecated No replacement. Do not use.
-     */
-    @Deprecated
-    public static void setBinder(GrailsDomainBinder binder) {
-    }
-
-    /**
-     * Populates criteria arguments for the given target class and arguments 
map
-     *
-     * @param targetClass The target class
-     * @param c The criteria instance
-     * @param argMap The arguments map
-     *
-     */
-    @Deprecated
-    @SuppressWarnings("rawtypes")
-    public static void populateArgumentsForCriteria(Class<?> targetClass, 
Criteria c, Map argMap, ConversionService conversionService) {
-        populateArgumentsForCriteria(null, targetClass, c, argMap, 
conversionService);
-    }
-
-    @SuppressWarnings("rawtypes")
-    public static void populateArgumentsForCriteria(Criteria c, Map argMap, 
ConversionService conversionService) {
-        populateArgumentsForCriteria(null, null, c, argMap, conversionService);
-    }
-
-    private static FlushMode convertFlushMode(Object object) {
-        if (object == null) {
-            return null;
-        }
-        if (object instanceof FlushMode) {
-            return (FlushMode) object;
-        }
-        return FlushMode.valueOf(String.valueOf(object));
-    }
-
-    /**
-     * Add order to criteria, creating necessary subCriteria if nested sort 
property (ie. sort:'nested.property').
-     */
-    private static void addOrderPossiblyNested(AbstractHibernateDatastore 
datastore, Criteria c, Class<?> targetClass, String sort, String order, boolean 
ignoreCase) {
-        int firstDotPos = sort.indexOf(".");
-        if (firstDotPos == -1) {
-            addOrder(c, sort, order, ignoreCase);
-        } else { // nested property
-            String sortHead = sort.substring(0, firstDotPos);
-            String sortTail = sort.substring(firstDotPos + 1);
-            PersistentProperty property = 
getGrailsDomainClassProperty(datastore, targetClass, sortHead);
-            if (property instanceof Embedded) {
-                // embedded objects cannot reference entities (at time of 
writing), so no more recursion needed
-                addOrder(c, sort, order, ignoreCase);
-            } else if (property instanceof Association) {
-                Criteria subCriteria = c.createCriteria(sortHead);
-                Class<?> propertyTargetClass = ((Association) 
property).getAssociatedEntity().getJavaClass();
-                GrailsHibernateUtil.cacheCriteriaByMapping(datastore, 
propertyTargetClass, subCriteria);
-                addOrderPossiblyNested(datastore, subCriteria, 
propertyTargetClass, sortTail, order, ignoreCase); // Recurse on nested sort
-            }
-        }
-    }
 
-    /**
-     * Add order directly to criteria.
-     */
-    private static void addOrder(Criteria c, String sort, String order, 
boolean ignoreCase) {
-        if (ORDER_DESC.equals(order)) {
-            c.addOrder(ignoreCase ? Order.desc(sort).ignoreCase() : 
Order.desc(sort));
-        }
-        else {
-            c.addOrder(ignoreCase ? Order.asc(sort).ignoreCase() : 
Order.asc(sort));
-        }
-    }
-
-    /**
-     * Get hold of the GrailsDomainClassProperty represented by the 
targetClass' propertyName,
-     * assuming targetClass corresponds to a GrailsDomainClass.
-     */
-    private static PersistentProperty 
getGrailsDomainClassProperty(AbstractHibernateDatastore datastore, Class<?> 
targetClass, String propertyName) {
-        PersistentEntity grailsClass = datastore != null ? 
datastore.getMappingContext().getPersistentEntity(targetClass.getName()) : null;
-        if (grailsClass == null) {
-            throw new IllegalArgumentException("Unexpected: class is not a 
domain class:" + targetClass.getName());
-        }
-        return grailsClass.getPropertyByName(propertyName);
-    }
+    private static final String VERSION_8_0 = "8.0";

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsHibernateUtil.java:
##########
@@ -62,256 +55,80 @@
  * @since 0.4
  */
 public class GrailsHibernateUtil extends HibernateRuntimeUtils {
-    protected static final Logger LOG = 
LoggerFactory.getLogger(GrailsHibernateUtil.class);
-
-    public static final String ARGUMENT_FETCH_SIZE = "fetchSize";
-    public static final String ARGUMENT_TIMEOUT = "timeout";
-    public static final String ARGUMENT_READ_ONLY = "readOnly";
-    public static final String ARGUMENT_FLUSH_MODE = "flushMode";
-    public static final String ARGUMENT_MAX = "max";
-    public static final String ARGUMENT_OFFSET = "offset";
-    public static final String ARGUMENT_ORDER = "order";
-    public static final String ARGUMENT_SORT = "sort";
-    public static final String ORDER_DESC = "desc";
-    public static final String ORDER_ASC = "asc";
-    public static final String ARGUMENT_FETCH = "fetch";
-    public static final String ARGUMENT_IGNORE_CASE = "ignoreCase";
-    public static final String ARGUMENT_CACHE = "cache";
-    public static final String ARGUMENT_LOCK = "lock";
-    public static final Class<?>[] EMPTY_CLASS_ARRAY = {};
-
-    private static HibernateProxyHandler proxyHandler = new 
HibernateProxyHandler();
-
-    public static void populateArgumentsForCriteria(AbstractHibernateDatastore 
datastore, Class<?> targetClass, Criteria c, Map argMap, ConversionService 
conversionService) {
-        populateArgumentsForCriteria(datastore, targetClass, c, argMap, 
conversionService, true);
-    }
-
-    /**
-     * Populates criteria arguments for the given target class and arguments 
map
-     *
-     * @param datastore the GrailsApplication instance
-     * @param targetClass The target class
-     * @param c The criteria instance
-     * @param argMap The arguments map
-     */
-    @SuppressWarnings("rawtypes")
-    public static void populateArgumentsForCriteria(AbstractHibernateDatastore 
datastore, Class<?> targetClass, Criteria c, Map argMap, ConversionService 
conversionService, boolean useDefaultMapping) {
-        Integer maxParam = null;
-        Integer offsetParam = null;
-        if (argMap.containsKey(ARGUMENT_MAX)) {
-            maxParam = conversionService.convert(argMap.get(ARGUMENT_MAX), 
Integer.class);
-        }
-        if (argMap.containsKey(ARGUMENT_OFFSET)) {
-            offsetParam = 
conversionService.convert(argMap.get(ARGUMENT_OFFSET), Integer.class);
-        }
-        if (argMap.containsKey(ARGUMENT_FETCH_SIZE)) {
-            
c.setFetchSize(conversionService.convert(argMap.get(ARGUMENT_FETCH_SIZE), 
Integer.class));
-        }
-        if (argMap.containsKey(ARGUMENT_TIMEOUT)) {
-            
c.setTimeout(conversionService.convert(argMap.get(ARGUMENT_TIMEOUT), 
Integer.class));
-        }
-        if (argMap.containsKey(ARGUMENT_FLUSH_MODE)) {
-            c.setFlushMode(convertFlushMode(argMap.get(ARGUMENT_FLUSH_MODE)));
-        }
-        if (argMap.containsKey(ARGUMENT_READ_ONLY)) {
-            c.setReadOnly(ClassUtils.getBooleanFromMap(ARGUMENT_READ_ONLY, 
argMap));
-        }
-        String orderParam = (String) argMap.get(ARGUMENT_ORDER);
-        Object fetchObj = argMap.get(ARGUMENT_FETCH);
-        if (fetchObj instanceof Map) {
-            Map fetch = (Map) fetchObj;
-            for (Object o : fetch.keySet()) {
-                String associationName = (String) o;
-                c.setFetchMode(associationName, 
getFetchMode(fetch.get(associationName)));
-            }
-        }
-
-        final int max = maxParam == null ? -1 : maxParam;
-        final int offset = offsetParam == null ? -1 : offsetParam;
-        if (max > -1) {
-            c.setMaxResults(max);
-        }
-        if (offset > -1) {
-            c.setFirstResult(offset);
-        }
-        if (ClassUtils.getBooleanFromMap(ARGUMENT_LOCK, argMap)) {
-            c.setLockMode(LockMode.PESSIMISTIC_WRITE);
-            c.setCacheable(false);
-        }
-        else {
-            if (argMap.containsKey(ARGUMENT_CACHE)) {
-                c.setCacheable(ClassUtils.getBooleanFromMap(ARGUMENT_CACHE, 
argMap));
-            } else {
-                cacheCriteriaByMapping(targetClass, c);
-            }
-        }
-
-        final Object sortObj = argMap.get(ARGUMENT_SORT);
-        if (sortObj != null) {
-            boolean ignoreCase = true;
-            Object caseArg = argMap.get(ARGUMENT_IGNORE_CASE);
-            if (caseArg instanceof Boolean) {
-                ignoreCase = (Boolean) caseArg;
-            }
-            if (sortObj instanceof Map) {
-                Map sortMap = (Map) sortObj;
-                for (Object sort : sortMap.keySet()) {
-                    final String order = ORDER_DESC.equalsIgnoreCase((String) 
sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
-                    addOrderPossiblyNested(datastore, c, targetClass, (String) 
sort, order, ignoreCase);
-                }
-            } else {
-                final String sort = (String) sortObj;
-                final String order = ORDER_DESC.equalsIgnoreCase(orderParam) ? 
ORDER_DESC : ORDER_ASC;
-                addOrderPossiblyNested(datastore, c, targetClass, sort, order, 
ignoreCase);
-            }
-        }
-        else if (useDefaultMapping) {
-            Mapping m = GrailsDomainBinder.getMapping(targetClass);
-            if (m != null) {
-                Map sortMap = m.getSort().getNamesAndDirections();
-                for (Object sort : sortMap.keySet()) {
-                    final String order = ORDER_DESC.equalsIgnoreCase((String) 
sortMap.get(sort)) ? ORDER_DESC : ORDER_ASC;
-                    addOrderPossiblyNested(datastore, c, targetClass, (String) 
sort, order, true);
-                }
-            }
-        }
-    }
-
-    /**
-     * @deprecated No replacement. Do not use.
-     */
-    @Deprecated
-    public static void setBinder(GrailsDomainBinder binder) {
-    }
-
-    /**
-     * Populates criteria arguments for the given target class and arguments 
map
-     *
-     * @param targetClass The target class
-     * @param c The criteria instance
-     * @param argMap The arguments map
-     *
-     */
-    @Deprecated
-    @SuppressWarnings("rawtypes")
-    public static void populateArgumentsForCriteria(Class<?> targetClass, 
Criteria c, Map argMap, ConversionService conversionService) {
-        populateArgumentsForCriteria(null, targetClass, c, argMap, 
conversionService);
-    }
-
-    @SuppressWarnings("rawtypes")
-    public static void populateArgumentsForCriteria(Criteria c, Map argMap, 
ConversionService conversionService) {
-        populateArgumentsForCriteria(null, null, c, argMap, conversionService);
-    }
-
-    private static FlushMode convertFlushMode(Object object) {
-        if (object == null) {
-            return null;
-        }
-        if (object instanceof FlushMode) {
-            return (FlushMode) object;
-        }
-        return FlushMode.valueOf(String.valueOf(object));
-    }
-
-    /**
-     * Add order to criteria, creating necessary subCriteria if nested sort 
property (ie. sort:'nested.property').
-     */
-    private static void addOrderPossiblyNested(AbstractHibernateDatastore 
datastore, Criteria c, Class<?> targetClass, String sort, String order, boolean 
ignoreCase) {
-        int firstDotPos = sort.indexOf(".");
-        if (firstDotPos == -1) {
-            addOrder(c, sort, order, ignoreCase);
-        } else { // nested property
-            String sortHead = sort.substring(0, firstDotPos);
-            String sortTail = sort.substring(firstDotPos + 1);
-            PersistentProperty property = 
getGrailsDomainClassProperty(datastore, targetClass, sortHead);
-            if (property instanceof Embedded) {
-                // embedded objects cannot reference entities (at time of 
writing), so no more recursion needed
-                addOrder(c, sort, order, ignoreCase);
-            } else if (property instanceof Association) {
-                Criteria subCriteria = c.createCriteria(sortHead);
-                Class<?> propertyTargetClass = ((Association) 
property).getAssociatedEntity().getJavaClass();
-                GrailsHibernateUtil.cacheCriteriaByMapping(datastore, 
propertyTargetClass, subCriteria);
-                addOrderPossiblyNested(datastore, subCriteria, 
propertyTargetClass, sortTail, order, ignoreCase); // Recurse on nested sort
-            }
-        }
-    }
 
-    /**
-     * Add order directly to criteria.
-     */
-    private static void addOrder(Criteria c, String sort, String order, 
boolean ignoreCase) {
-        if (ORDER_DESC.equals(order)) {
-            c.addOrder(ignoreCase ? Order.desc(sort).ignoreCase() : 
Order.desc(sort));
-        }
-        else {
-            c.addOrder(ignoreCase ? Order.asc(sort).ignoreCase() : 
Order.asc(sort));
-        }
-    }
-
-    /**
-     * Get hold of the GrailsDomainClassProperty represented by the 
targetClass' propertyName,
-     * assuming targetClass corresponds to a GrailsDomainClass.
-     */
-    private static PersistentProperty 
getGrailsDomainClassProperty(AbstractHibernateDatastore datastore, Class<?> 
targetClass, String propertyName) {
-        PersistentEntity grailsClass = datastore != null ? 
datastore.getMappingContext().getPersistentEntity(targetClass.getName()) : null;
-        if (grailsClass == null) {
-            throw new IllegalArgumentException("Unexpected: class is not a 
domain class:" + targetClass.getName());
-        }
-        return grailsClass.getPropertyByName(propertyName);
-    }
+    private static final String VERSION_8_0 = "8.0";
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#FETCH_SIZE} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_FETCH_SIZE = 
HibernateQueryArgument.FETCH_SIZE.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#TIMEOUT} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_TIMEOUT = 
HibernateQueryArgument.TIMEOUT.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#READ_ONLY} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_READ_ONLY = 
HibernateQueryArgument.READ_ONLY.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#FLUSH_MODE} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_FLUSH_MODE = 
HibernateQueryArgument.FLUSH_MODE.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#MAX} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_MAX = 
HibernateQueryArgument.MAX.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#OFFSET} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_OFFSET = 
HibernateQueryArgument.OFFSET.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#ORDER} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_ORDER = 
HibernateQueryArgument.ORDER.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#SORT} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_SORT = 
HibernateQueryArgument.SORT.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#ORDER_DESC} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ORDER_DESC = 
HibernateQueryArgument.ORDER_DESC.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#ORDER_ASC} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ORDER_ASC = 
HibernateQueryArgument.ORDER_ASC.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#FETCH} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_FETCH = 
HibernateQueryArgument.FETCH.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#IGNORE_CASE} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_IGNORE_CASE = 
HibernateQueryArgument.IGNORE_CASE.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#CACHE} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_CACHE = 
HibernateQueryArgument.CACHE.value();
+    /** @deprecated Use {@link 
org.grails.orm.hibernate.query.HibernateQueryArgument#LOCK} */
+    @Deprecated(since = VERSION_8_0, forRemoval = true)
+    public static final String ARGUMENT_LOCK = 
HibernateQueryArgument.LOCK.value();
 
-    /**
-     * Configures the criteria instance to cache based on the configured 
mapping.
-     *
-     * @param targetClass The target class
-     * @param criteria The criteria
-     */
-    public static void cacheCriteriaByMapping(Class<?> targetClass, Criteria 
criteria) {
-        Mapping m = GrailsDomainBinder.getMapping(targetClass);
-        if (m != null && m.getCache() != null && m.getCache().getEnabled()) {
-            criteria.setCacheable(true);
-        }
-    }
+    protected static final Logger LOG = 
LoggerFactory.getLogger(GrailsHibernateUtil.class);
 
-    public static void cacheCriteriaByMapping(AbstractHibernateDatastore 
datastore, Class<?> targetClass, Criteria criteria) {
-        cacheCriteriaByMapping(targetClass, criteria);
-    }
+    private static HibernateProxyHandler proxyHandler = new 
HibernateProxyHandler();
 
-    /**
-     * Retrieves the fetch mode for the specified instance; otherwise returns 
the default FetchMode.
-     *
-     * @param object The object, converted to a string
-     * @return The FetchMode
-     */
-    public static FetchMode getFetchMode(Object object) {
-        String name = object != null ? object.toString() : "default";
-        if (name.equalsIgnoreCase(FetchMode.JOIN.toString()) || 
name.equalsIgnoreCase("eager")) {
-            return FetchMode.JOIN;
-        }
-        if (name.equalsIgnoreCase(FetchMode.SELECT.toString()) || 
name.equalsIgnoreCase("lazy")) {
-            return FetchMode.SELECT;
-        }
-        return FetchMode.DEFAULT;
+    public static void setProxyHandler(HibernateProxyHandler handler) {

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/cfg/JoinTable.groovy:
##########
@@ -36,9 +36,24 @@ import groovy.transform.builder.SimpleStrategy
 class JoinTable extends Table {
 
     /**
-     * The foreign key column
+     * The foreign key columns (composite key support)
      */
-    ColumnConfig key
+    List<ColumnConfig> keys = []
+
+    void setKeys(List<ColumnConfig> keys) {
+        this.keys = keys
+    }
+
+    /**
+     * Configures the keys
+     * @param names The key names
+     * @return This join table config
+     */
+    JoinTable keys(List names) {
+        this.keys = (List<ColumnConfig>) names.collect { it instanceof 
ColumnConfig ? it : new ColumnConfig(name: it.toString()) }
+        return this
+    }
+

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/cfg/PropertyConfig.groovy:
##########
@@ -473,4 +476,8 @@ class PropertyConfig extends Property {
         }
         return pc
     }
+
+    boolean hasJoinKeyMapping() {

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to