if (isBaseRepository(repositoryInterface)) {
JpaEntityInformation<M, ID> entityInformation = getEntityInformation((Class<M>) metadata.getDomainType());
SimpleBaseRepository repository = new SimpleBaseRepository<M, ID>(entityInformation, entityManager);
SearchableQuery searchableQuery = AnnotationUtils.findAnnotation(repositoryInterface, SearchableQuery.class);
if (searchableQuery != null) {
String countAllQL = searchableQuery.countAllQuery();
if (!StringUtils.isEmpty(countAllQL)) {
repository.setCountAllQL(countAllQL);
}
String findAllQL = searchableQuery.findAllQuery();
if (!StringUtils.isEmpty(findAllQL)) {
repository.setFindAllQL(findAllQL);
}
Class<? extends SearchCallback> callbackClass = searchableQuery.callbackClass();
if (callbackClass != null && callbackClass != SearchCallback.class) {
repository.setSearchCallback(BeanUtils.instantiate(callbackClass));
}
repository.setJoins(searchableQuery.joins());
}
return repository;
}