Refactor DatasetMigrationService

This commit is contained in:
Thomas Georgios Giannos 2023-11-23 15:27:02 +02:00
parent f38febc22b
commit eae9a5f7d3
1 changed files with 0 additions and 18 deletions

View File

@ -55,24 +55,6 @@ public class DatasetMigrationService {
this.entityManager = entityManager;
}
public QueryableList<Dataset> datasetQueryableList() {
return databaseRepository.getDatasetDao().asQueryable();
}
public List<DatasetWizardModel> getDatasets(Integer skip, Integer take) {
List<Dataset> datasets = datasetQueryableList()
.orderBy((builder, root) -> builder.desc(root.get("created")))
.skip(skip)
.take(take)
.toList();
return datasets.stream().map(x -> {
DatasetWizardModel dataset = new DatasetWizardModel();
dataset.fromDataModel(x);
return dataset;
}).toList();
}
public void migrate() throws IOException, JAXBException, ParserConfigurationException, InstantiationException, IllegalAccessException, SAXException {
DatasetDao datasetDao = databaseRepository.getDatasetDao();
long total = datasetDao.asQueryable().count();