Repository: quarkusio/quarkus
Issue: Spring Data JPA custom query with countQuery breaks in dev mode

**Describe the bug**
There is a classloader issue when using the spring-data-jpa integration test in dev mode.

**Expected behavior**
Dev-mode should behave the same as regular mode.

**Actual behavior**
java.lang.LinkageError: io/quarkus/hibernate/orm/panache/PanacheQuery
	at io.quarkus.it.spring.data.jpa.MovieRepository_4263b43a08c2ca0cc9a7dd59c4e59bb4f9386bbdImpl.customFind(MovieRepository_4263b43a08c2ca0cc9a7dd59c4e59bb4f9386bbdImpl.zig:381)
	at io.quarkus.it.spring.data.jpa.MovieRepository_4263b43a08c2ca0cc9a7dd59c4e59bb4f9386bbdImpl_ClientProxy.customFind(MovieRepository_4263b43a08c2ca0cc9a7dd59c4e59bb4f9386bbdImpl_ClientProxy.zig:430)


**To Reproduce**
Steps to reproduce the behavior:
1. cd `integration-tests/spring-data-jpa` in Quarkus repo
2. `mvn clean quarkus:dev`
3. hit `http://localhost:8080/movie/customFind/page/1/0`

This only appears after the change in #5823 was made.

Changed files:
extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/CustomCountPanacheQuery.java
extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/AdditionalJpaOperations.java

diff --git a/extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/AdditionalJpaOperations.java b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/AdditionalJpaOperations.java
similarity index 90%
rename from extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/AdditionalJpaOperations.java
rename to extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/AdditionalJpaOperations.java
index 4ab7fe9800a..cc267002b26 100644
--- a/extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/AdditionalJpaOperations.java
+++ b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/AdditionalJpaOperations.java
@@ -9,6 +9,8 @@
 import io.quarkus.panache.common.Parameters;
 import io.quarkus.panache.common.Sort;
 
+//TODO this class is only needed by the Spring Data JPA module and would be placed there it it weren't for a dev-mode classloader issue
+// see https://github.com/quarkusio/quarkus/issues/6214
 public class AdditionalJpaOperations {
 
     @SuppressWarnings("rawtypes")
@@ -19,7 +21,6 @@ public static PanacheQuery<?> find(Class<?> entityClass, String query, String co
         Query jpaQuery = em.createQuery(sort != null ? findQuery + JpaOperations.toOrderBy(sort) : findQuery);
         JpaOperations.bindParameters(jpaQuery, params);
         return new CustomCountPanacheQuery(em, jpaQuery, findQuery, countQuery, params);
-        //        return new PanacheQueryImpl(em, jpaQuery, findQuery, params);
     }
 
     @SuppressWarnings("rawtypes")
@@ -35,6 +36,5 @@ public static PanacheQuery<?> find(Class<?> entityClass, String query, String co
         Query jpaQuery = em.createQuery(sort != null ? findQuery + JpaOperations.toOrderBy(sort) : findQuery);
         JpaOperations.bindParameters(jpaQuery, params);
         return new CustomCountPanacheQuery(em, jpaQuery, findQuery, countQuery, params);
-        //        return new PanacheQueryImpl(em, jpaQuery, findQuery, params);
     }
 }
diff --git a/extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/CustomCountPanacheQuery.java b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/CustomCountPanacheQuery.java
similarity index 75%
rename from extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/CustomCountPanacheQuery.java
rename to extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/CustomCountPanacheQuery.java
index 0694fef6e40..dbe86a37471 100644
--- a/extensions/spring-data-jpa/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/CustomCountPanacheQuery.java
+++ b/extensions/panache/hibernate-orm-panache/runtime/src/main/java/io/quarkus/hibernate/orm/panache/runtime/CustomCountPanacheQuery.java
@@ -3,6 +3,8 @@
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
 
+//TODO this class is only needed by the Spring Data JPA module and would be placed there it it weren't for a dev-mode classloader issue
+// see https://github.com/quarkusio/quarkus/issues/6214
 public class CustomCountPanacheQuery<Entity> extends PanacheQueryImpl<Entity> {
 
     private final String customCountQuery;