Minor Refactoring

This commit is contained in:
George Kalampokis 2022-04-29 13:32:22 +03:00
parent d7653f374c
commit 53d38088cd
2 changed files with 4 additions and 2 deletions

View File

@ -17,7 +17,7 @@ import java.io.IOException;
*/
public abstract class ElasticRepository<T extends ElasticEntity,C extends Criteria> implements Repository<T,C> {
private static final Logger logger = LoggerFactory.getLogger(ElasticRepository.class);
private final ObjectMapper mapper = new ObjectMapper();
private final ObjectMapper mapper;
private RestHighLevelClient client;
public RestHighLevelClient getClient() {
@ -33,6 +33,7 @@ public abstract class ElasticRepository<T extends ElasticEntity,C extends Criter
logger.warn("Unable to connect to Elastic Services");
this.client = null;
}
this.mapper = new ObjectMapper();
}
public <T> T transformFromString(String value, Class<T> tClass) {

View File

@ -168,7 +168,7 @@ public class DatasetManager {
datasets = null;
}
UserInfo userInfo = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());//builderFactory.getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
// QueryableList<eu.eudat.data.entities.Dataset> items = databaseRepository.getDatasetDao().getWithCriteria(datasetTableRequest.getCriteria()).withHint(HintedModelFactory.getHint(DatasetListingModel.class));
QueryableList<eu.eudat.data.entities.Dataset> items;
if (datasets != null && !datasets.isEmpty()) {
@ -186,6 +186,7 @@ public class DatasetManager {
if (principal.getId() == null) {
throw new UnauthorisedException("You are not allowed to access those datasets");
}
UserInfo userInfo = apiContext.getOperationsContext().getDatabaseRepository().getUserInfoDao().find(principal.getId());//builderFactory.getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
if (datasetTableRequest.getCriteria().getRole() != null) {
roles.add(datasetTableRequest.getCriteria().getRole());
}