diff --git a/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java b/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java index 281f3e5d9..c9800a002 100644 --- a/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java +++ b/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java @@ -102,7 +102,7 @@ public class SimpleJpaRepository implements JpaRepos this.lockMetadataProvider = lockMetadataProvider; } - private Class getDomainClass() { + protected Class getDomainClass() { return entityInformation.getJavaType(); } @@ -425,7 +425,7 @@ public class SimpleJpaRepository implements JpaRepos * @param pageable can be {@literal null}. * @return */ - private Page readPage(TypedQuery query, Pageable pageable, Specification spec) { + protected Page readPage(TypedQuery query, Pageable pageable, Specification spec) { query.setFirstResult(pageable.getOffset()); query.setMaxResults(pageable.getPageSize()); @@ -443,7 +443,7 @@ public class SimpleJpaRepository implements JpaRepos * @param pageable can be {@literal null}. * @return */ - private TypedQuery getQuery(Specification spec, Pageable pageable) { + protected TypedQuery getQuery(Specification spec, Pageable pageable) { Sort sort = pageable == null ? null : pageable.getSort(); return getQuery(spec, sort); @@ -456,7 +456,7 @@ public class SimpleJpaRepository implements JpaRepos * @param sort can be {@literal null}. * @return */ - private TypedQuery getQuery(Specification spec, Sort sort) { + protected TypedQuery getQuery(Specification spec, Sort sort) { CriteriaBuilder builder = em.getCriteriaBuilder(); CriteriaQuery query = builder.createQuery(getDomainClass()); @@ -477,7 +477,7 @@ public class SimpleJpaRepository implements JpaRepos * @param spec can be {@literal null}. * @return */ - private TypedQuery getCountQuery(Specification spec) { + protected TypedQuery getCountQuery(Specification spec) { CriteriaBuilder builder = em.getCriteriaBuilder(); CriteriaQuery query = builder.createQuery(Long.class);