This is an automated email from the ASF dual-hosted git repository.

borinquenkid pushed a commit to branch merge-hibernate6
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit 164827a375b5a4132308a4aa2c487ad3cb501cfd
Author: Walter Duque de Estrada <[email protected]>
AuthorDate: Sun Jun 8 19:23:45 2025 -0500

    Fixing clone method
---
 .../src/main/groovy/org/grails/orm/hibernate/query/HibernateQuery.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/grails-data-hibernate6/core/src/main/groovy/org/grails/orm/hibernate/query/HibernateQuery.java
 
b/grails-data-hibernate6/core/src/main/groovy/org/grails/orm/hibernate/query/HibernateQuery.java
index eed523ba0a..2801c1f3a6 100644
--- 
a/grails-data-hibernate6/core/src/main/groovy/org/grails/orm/hibernate/query/HibernateQuery.java
+++ 
b/grails-data-hibernate6/core/src/main/groovy/org/grails/orm/hibernate/query/HibernateQuery.java
@@ -243,6 +243,7 @@ public class HibernateQuery extends AbstractHibernateQuery {
             HibernateQuery hibernateQuery = new 
HibernateQuery(hibernateSession, entity);
             hibernateQuery.max(this.max);
             hibernateQuery.offset(this.offset);
+            hibernateQuery.setDetachedCriteria(this.detachedCriteria);
             this.projections.getProjectionList().forEach(projection -> 
{hibernateQuery.projections().add(projection);});;
             getCriteria().getCriteria().forEach(hibernateQuery::add);
             return hibernateQuery;

Reply via email to