diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/DMP.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/DMP.java index 46b234607..c00aac796 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/DMP.java +++ b/dmp-backend/core/src/main/java/eu/eudat/data/old/DMP.java @@ -185,7 +185,7 @@ public class DMP implements DataEntity { @Convert(converter = DateToUTCConverter.class) private Date publishedAt; - @OneToMany(mappedBy = "entityId", fetch = FetchType.LAZY) + @Transient private Set dois; @ManyToOne(fetch = FetchType.LAZY) diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/DataRepository.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/DataRepository.java index cede009d5..be5b0d4f4 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/DataRepository.java +++ b/dmp-backend/core/src/main/java/eu/eudat/data/old/DataRepository.java @@ -36,9 +36,6 @@ public class DataRepository implements Serializable, DataEntity datasetDataRepositories; - @Column(name = "\"Status\"", nullable = false) private Short status; @@ -116,13 +113,6 @@ public class DataRepository implements Serializable, DataEntity getDatasetDataRepositories() { - return datasetDataRepositories; - } - public void setDatasetDataRepositories(Set datasetDataRepositories) { - this.datasetDataRepositories = datasetDataRepositories; - } - public UserInfo getCreationUser() { return creationUser; } diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetDataRepository.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetDataRepository.java deleted file mode 100644 index 7a4e55a39..000000000 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetDataRepository.java +++ /dev/null @@ -1,98 +0,0 @@ -package eu.eudat.data.old; - -import eu.eudat.data.DescriptionEntity; -import eu.eudat.data.old.helpers.EntityBinder; -import eu.eudat.queryable.queryableentity.DataEntity; -import org.hibernate.annotations.GenericGenerator; - -import jakarta.persistence.*; -import java.util.List; -import java.util.UUID; - -/** - * Created by ikalyvas on 5/22/2018. - */ - -@Entity -@Table(name = "\"DatasetDataRepository\"") -public class DatasetDataRepository implements DataEntity { - - @Id - @GeneratedValue - @GenericGenerator(name = "uuid2", strategy = "uuid2") - @Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") - private UUID id; - - @ManyToOne - @JoinColumn(name = "\"Dataset\"", nullable = false) - private DescriptionEntity descriptionEntity; - - @ManyToOne - @JoinColumn(name = "\"DataRepository\"", nullable = false) - private DataRepository dataRepository; - - @Column(name = "\"Role\"") - private Integer role; - - @Column(name = "\"Data\"") - private String data; - - public UUID getId() { - return id; - } - - public void setId(UUID id) { - this.id = id; - } - - public DescriptionEntity getDataset() { - return descriptionEntity; - } - - public void setDataset(DescriptionEntity descriptionEntity) { - this.descriptionEntity = descriptionEntity; - } - - public DataRepository getDataRepository() { - return dataRepository; - } - - public void setDataRepository(DataRepository dataRepository) { - this.dataRepository = dataRepository; - } - - public Integer getRole() { - return role; - } - - public void setRole(Integer role) { - this.role = role; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - - @Override - public void update(DatasetDataRepository entity) { - this.descriptionEntity = entity.getDataset(); - this.dataRepository = entity.getDataRepository(); - this.role = entity.getRole(); - } - - @Override - public UUID getKeys() { - return this.id; - } - - @Override - public DatasetDataRepository buildFromTuple(List tuple, List fields, String base) { - String currentBase = base.isEmpty() ? "" : base + "."; - if (fields.contains(currentBase + "id")) this.id = EntityBinder.fromTuple(tuple, currentBase + "id"); - return this; - } -} diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetExternalDataset.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetExternalDataset.java deleted file mode 100644 index 27812512d..000000000 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetExternalDataset.java +++ /dev/null @@ -1,96 +0,0 @@ -package eu.eudat.data.old; - -import eu.eudat.data.DescriptionEntity; -import eu.eudat.data.old.helpers.EntityBinder; -import eu.eudat.queryable.queryableentity.DataEntity; -import org.hibernate.annotations.GenericGenerator; - -import jakarta.persistence.*; -import java.util.List; -import java.util.UUID; - - -@Entity -@Table(name = "\"DatasetExternalDataset\"") -public class DatasetExternalDataset implements DataEntity { - - @Id - @GeneratedValue - @GenericGenerator(name = "uuid2", strategy = "uuid2") - @Column(name = "\"Id\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") - private UUID id; - - @ManyToOne - @JoinColumn(name = "\"Dataset\"", nullable = false) - private DescriptionEntity descriptionEntity; - - @ManyToOne - @JoinColumn(name = "\"ExternalDataset\"", nullable = false) - private ExternalDataset externalDataset; - - @Column(name = "\"Role\"") - private Integer role; - - @Column(name = "\"Data\"") - private String data; - - - public UUID getId() { - return id; - } - - public void setId(UUID id) { - this.id = id; - } - - public DescriptionEntity getDataset() { - return descriptionEntity; - } - - public void setDataset(DescriptionEntity descriptionEntity) { - this.descriptionEntity = descriptionEntity; - } - - public ExternalDataset getExternalDataset() { - return externalDataset; - } - - public void setExternalDataset(ExternalDataset externalDataset) { - this.externalDataset = externalDataset; - } - - public Integer getRole() { - return role; - } - - public void setRole(Integer role) { - this.role = role; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - - @Override - public void update(DatasetExternalDataset entity) { - this.descriptionEntity = entity.getDataset(); - this.externalDataset = entity.getExternalDataset(); - this.role = entity.getRole(); - } - - @Override - public UUID getKeys() { - return this.id; - } - - @Override - public DatasetExternalDataset buildFromTuple(List tuple, List fields, String base) { - String currentBase = base.isEmpty() ? "" : base + "."; - if (fields.contains(currentBase + "id")) this.id = EntityBinder.fromTuple(tuple, currentBase + "id"); - return this; - } -} diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetRegistry.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetRegistry.java deleted file mode 100644 index 14c87e58c..000000000 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetRegistry.java +++ /dev/null @@ -1,75 +0,0 @@ -package eu.eudat.data.old; - - -import org.hibernate.annotations.GenericGenerator; -import org.hibernate.annotations.Type; - -import jakarta.persistence.*; -import java.io.Serializable; -import java.util.UUID; - - -@Entity -@Table(name = "\"DatasetRegistry\"") -public class DatasetRegistry { - - @Id - @GeneratedValue - @GenericGenerator(name = "uuid2", strategy = "uuid2") - @Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") - private UUID id; - - //DEPWARN dependency to Hibernate and PostgreSQL - @Column(name = "\"Dataset\"", nullable = false) - private UUID dataset; - - //DEPWARN dependency to Hibernate and PostgreSQL - @Column(name = "\"Registry\"", nullable = false) - private UUID registry; - - @Column(name = "\"Role\"") - private Integer role; - - @Column(name = "\"Data\"") - private String data; - - public UUID getId() { - return id; - } - - public void setId(UUID id) { - this.id = id; - } - - public UUID getDataset() { - return dataset; - } - - public void setDataset(UUID dataset) { - this.dataset = dataset; - } - - public UUID getRegistry() { - return registry; - } - - public void setRegistry(UUID registry) { - this.registry = registry; - } - - public Integer getRole() { - return role; - } - - public void setRole(Integer role) { - this.role = role; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } -} diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetService.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetService.java deleted file mode 100644 index 6031b6f5b..000000000 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/DatasetService.java +++ /dev/null @@ -1,97 +0,0 @@ -package eu.eudat.data.old; - - -import eu.eudat.data.DescriptionEntity; -import eu.eudat.queryable.queryableentity.DataEntity; -import org.hibernate.annotations.GenericGenerator; - -import jakarta.persistence.*; -import java.util.List; -import java.util.UUID; - - -@Entity -@Table(name = "\"DatasetService\"") -public class DatasetService implements DataEntity { - - @Id - @GeneratedValue - @GenericGenerator(name = "uuid2", strategy = "uuid2") - @Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") - private UUID id; - - - @ManyToOne - @JoinColumn(name = "\"Dataset\"", nullable = false) - private DescriptionEntity descriptionEntity; - - @ManyToOne - @JoinColumn(name = "\"Service\"", nullable = false) - private Service service; - - @Column(name = "\"Role\"") - private Integer role; - - @Column(name = "\"Data\"") - private String data; - - - public UUID getId() { - return id; - } - - public void setId(UUID id) { - this.id = id; - } - - public DescriptionEntity getDataset() { - return descriptionEntity; - } - - public void setDataset(DescriptionEntity descriptionEntity) { - this.descriptionEntity = descriptionEntity; - } - - public Service getService() { - return service; - } - - public void setService(Service service) { - this.service = service; - } - - public Integer getRole() { - return role; - } - - public void setRole(Integer role) { - this.role = role; - } - - public String getData() { - return data; - } - - public void setData(String data) { - this.data = data; - } - - @Override - public void update(DatasetService entity) { - this.descriptionEntity = entity.getDataset(); - this.service = entity.getService(); - this.role = entity.getRole(); - } - - @Override - public UUID getKeys() { - return this.id; - } - - @Override - public DatasetService buildFromTuple(List tuple, List fields, String base) { - String currentBase = base.isEmpty() ? "" : base + "."; - if(fields.contains(currentBase + "id")) this.id = UUID.fromString((String) tuple.get(0).get(currentBase + "id")); - return this; - } -} diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/ExternalDataset.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/ExternalDataset.java index e7b276bfe..87dafd05c 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/ExternalDataset.java +++ b/dmp-backend/core/src/main/java/eu/eudat/data/old/ExternalDataset.java @@ -36,9 +36,6 @@ public class ExternalDataset implements DataEntity { @Convert(converter = DateToUTCConverter.class) private Date modified; - @OneToMany(mappedBy = "externalDataset", cascade = CascadeType.ALL, orphanRemoval = true) - private Set datasets; - @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "\"CreationUser\"", nullable = true) private UserInfo creationUser; @@ -86,13 +83,6 @@ public class ExternalDataset implements DataEntity { this.modified = modified; } - public Set getDatasets() { - return datasets; - } - public void setDatasets(Set datasets) { - this.datasets = datasets; - } - public UserInfo getCreationUser() { return creationUser; } diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/old/Service.java b/dmp-backend/core/src/main/java/eu/eudat/data/old/Service.java index 324b0829a..732b89927 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/data/old/Service.java +++ b/dmp-backend/core/src/main/java/eu/eudat/data/old/Service.java @@ -36,9 +36,6 @@ public class Service implements DataEntity { @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) private String definition; - @OneToMany(mappedBy = "service", cascade = CascadeType.ALL, orphanRemoval = true) - private Set services; - @Column(name = "\"Status\"", nullable = false) private Short status; @@ -118,13 +115,6 @@ public class Service implements DataEntity { this.definition = definition; } - public Set getServices() { - return services; - } - public void setServices(Set services) { - this.services = services; - } - public UserInfo getCreationUser() { return creationUser; } diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDao.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDao.java deleted file mode 100644 index a77ac8579..000000000 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package eu.eudat.data.dao.entities; - -import eu.eudat.data.dao.DatabaseAccessLayer; -import eu.eudat.data.old.DatasetExternalDataset; - -import java.util.UUID; - -/** - * Created by ikalyvas on 5/22/2018. - */ -public interface DatasetExternalDatasetDao extends DatabaseAccessLayer { - -} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDaoImpl.java deleted file mode 100644 index 8bcb2ff07..000000000 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetExternalDatasetDaoImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package eu.eudat.data.dao.entities; - -import eu.eudat.data.dao.DatabaseAccess; -import eu.eudat.data.dao.databaselayer.service.DatabaseService; -import eu.eudat.data.old.DatasetExternalDataset; -import eu.eudat.queryable.QueryableList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import javax.management.InvalidApplicationException; -import java.util.UUID; -import java.util.concurrent.CompletableFuture; - -/** - * Created by ikalyvas on 5/22/2018. - */ -@Component("datasetExternalDatasetDao") -public class DatasetExternalDatasetDaoImpl extends DatabaseAccess implements DatasetExternalDatasetDao { - - @Autowired - public DatasetExternalDatasetDaoImpl(DatabaseService databaseService) { - super(databaseService); - } - - @Override - public DatasetExternalDataset createOrUpdate(DatasetExternalDataset item) { - return this.getDatabaseService().createOrUpdate(item,DatasetExternalDataset.class); - } - - @Override - public CompletableFuture createOrUpdateAsync(DatasetExternalDataset item) { - return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item)); - } - - @Override - @Async - public DatasetExternalDataset find(UUID id) throws InvalidApplicationException { - return getDatabaseService().getQueryable(DatasetExternalDataset.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle(); - } - - @Override - public DatasetExternalDataset find(UUID id, String hint) { - throw new UnsupportedOperationException(); - } - - - @Override - public void delete(DatasetExternalDataset item) { - this.getDatabaseService().delete(item); - } - - @Override - public QueryableList asQueryable() { - return this.getDatabaseService().getQueryable(DatasetExternalDataset.class); - } -} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDao.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDao.java deleted file mode 100644 index 62536194e..000000000 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDao.java +++ /dev/null @@ -1,12 +0,0 @@ -package eu.eudat.data.dao.entities; - -import eu.eudat.data.dao.DatabaseAccessLayer; -import eu.eudat.data.old.DatasetService; - -import java.util.UUID; - -/** - * Created by ikalyvas on 5/22/2018. - */ -public interface DatasetServiceDao extends DatabaseAccessLayer { -} diff --git a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDaoImpl.java b/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDaoImpl.java deleted file mode 100644 index a19e1fd0b..000000000 --- a/dmp-backend/data/src/main/java/eu/eudat/data/dao/entities/DatasetServiceDaoImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package eu.eudat.data.dao.entities; - -import eu.eudat.data.dao.DatabaseAccess; -import eu.eudat.data.dao.databaselayer.service.DatabaseService; -import eu.eudat.data.old.DatasetService; -import eu.eudat.queryable.QueryableList; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; - -import javax.management.InvalidApplicationException; -import java.util.UUID; -import java.util.concurrent.CompletableFuture; - -/** - * Created by ikalyvas on 5/22/2018. - */ -@Component("datasetServiceDao") -public class DatasetServiceDaoImpl extends DatabaseAccess implements DatasetServiceDao { - - @Autowired - public DatasetServiceDaoImpl(DatabaseService databaseService) { - super(databaseService); - } - - @Override - public DatasetService createOrUpdate(DatasetService item) { - return this.getDatabaseService().createOrUpdate(item, DatasetService.class); - } - - @Async - @Override - public CompletableFuture createOrUpdateAsync(DatasetService item) { - return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item)); - } - - @Override - public DatasetService find(UUID id) throws InvalidApplicationException { - return getDatabaseService().getQueryable(DatasetService.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle(); - } - - @Override - public DatasetService find(UUID id, String hint) { - throw new UnsupportedOperationException(); - } - - @Override - public void delete(DatasetService item) { - this.getDatabaseService().delete(item); - } - - @Override - public QueryableList asQueryable() { - return this.getDatabaseService().getQueryable(DatasetService.class); - } -} diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java index d707ea0ec..382b0a481 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepository.java @@ -41,10 +41,6 @@ public interface DatabaseRepository { ContentDao getContentDao(); - DatasetExternalDatasetDao getDatasetExternalDatasetDao(); - - DatasetServiceDao getDatasetServiceDao(); - EmailConfirmationDao getLoginConfirmationEmailDao(); ProjectDao getProjectDao(); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java index 34edba99f..1369f35b2 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/DatabaseRepositoryImpl.java @@ -45,10 +45,6 @@ public class DatabaseRepositoryImpl implements DatabaseRepository { private ContentDao contentDao; - private DatasetExternalDatasetDao datasetExternalDatasetDao; - - private DatasetServiceDao datasetServiceDao; - private EmailConfirmationDao loginConfirmationEmailDao; private ProjectDao projectDao; @@ -238,26 +234,6 @@ public class DatabaseRepositoryImpl implements DatabaseRepository { this.contentDao = contentDao; } - @Override - public DatasetExternalDatasetDao getDatasetExternalDatasetDao() { - return datasetExternalDatasetDao; - } - - @Autowired - public void setDatasetExternalDatasetDao(DatasetExternalDatasetDao datasetExternalDatasetDao) { - this.datasetExternalDatasetDao = datasetExternalDatasetDao; - } - - @Override - public DatasetServiceDao getDatasetServiceDao() { - return datasetServiceDao; - } - - @Autowired - public void setDatasetServiceDao(DatasetServiceDao datasetServiceDao) { - this.datasetServiceDao = datasetServiceDao; - } - @Override public EmailConfirmationDao getLoginConfirmationEmailDao() { return loginConfirmationEmailDao; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dataset/Dataset.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dataset/Dataset.java index 9678024f6..516201374 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dataset/Dataset.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dataset/Dataset.java @@ -1,17 +1,13 @@ package eu.eudat.models.data.dataset; import eu.eudat.data.DescriptionEntity; -import eu.eudat.data.old.DatasetDataRepository; -import eu.eudat.data.old.DatasetService; import eu.eudat.models.DataModel; import eu.eudat.models.data.datasetprofile.DatasetProfileListingModel; import eu.eudat.models.data.dmp.DataManagementPlan; import java.util.Date; -import java.util.HashSet; import java.util.List; import java.util.UUID; -import java.util.stream.Collectors; public class Dataset implements DataModel { private UUID id;