DATAES-264 - Make available the entity class of the repository so generic code can be written more easily.

This commit is contained in:
Zsombor Gegesy 2016-06-17 13:22:06 +02:00 committed by Artur Konczak
parent 392a87ab0a
commit edfca24527
2 changed files with 3 additions and 0 deletions

View File

@ -43,4 +43,6 @@ public interface ElasticsearchRepository<T, ID extends Serializable> extends Ela
Page<T> searchSimilar(T entity, String[] fields, Pageable pageable);
void refresh();
Class<T> getEntityClass();
}

View File

@ -276,6 +276,7 @@ public abstract class AbstractElasticsearchRepository<T, ID extends Serializable
return resolveReturnedClassFromGenericType(clazz.getSuperclass());
}
@Override
public Class<T> getEntityClass() {
if (!isEntityClassSet()) {
try {