infobip-spring-data-querydsl
infobip-spring-data-querydsl copied to clipboard
hibernate 2nd cache with predicate findAll
@NoRepositoryBean
public interface ExtendedCommonEntityDataPolicyDao<
T extends AbstractPersistableEntity, Q extends EntityPath<?>
>
extends ExtendedQuerydslJpaRepository<T, Long>, QuerydslBinderCustomizer<Q> {
// ...
}
@Repository
@Primary
public interface SysGrpDao extends ExtendedCommonEntityDataPolicyDao<SysGrp, QSysGrp> {
/* Query */
}
findAll
method not hint 2nd cache.
but Spring's findById it working.
@QueryHints(@QueryHint(name = org.hibernate.annotations.QueryHints.CACHEABLE, value = "true"))
default Page<T> policyFindAll(@Nonnull Pageable pageable) {
return findAll(pageable);
}
not working even with @QueryHints
I must admit I haven't used 2nd level cache in the past so I'll have to spend time digging regarding this one. Do you by any chance have time to create a test repo that reproduces the issue?
@tianyu94 it'd greatly help if you could provide a small project that reproduces the issue.