diff --git a/dmp-backend/core/src/main/java/eu/eudat/data/ReferenceEntity.java b/dmp-backend/core/src/main/java/eu/eudat/data/ReferenceEntity.java index 5122f7b31..060ac36a3 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/data/ReferenceEntity.java +++ b/dmp-backend/core/src/main/java/eu/eudat/data/ReferenceEntity.java @@ -53,7 +53,7 @@ public class ReferenceEntity { @Column(name = "source_type", nullable = false) @Convert(converter = ReferenceSourceTypeConverter.class) - private ReferenceSourceType referenceSourceType; + private ReferenceSourceType sourceType; public static final String _sourceType = "sourceType"; @Column(name = "is_active", nullable = false) @@ -137,12 +137,12 @@ public class ReferenceEntity { this.source = source; } - public ReferenceSourceType getReferenceSourceType() { - return referenceSourceType; + public ReferenceSourceType getSourceType() { + return sourceType; } - public void setReferenceSourceType(ReferenceSourceType referenceSourceType) { - this.referenceSourceType = referenceSourceType; + public void setSourceType(ReferenceSourceType referenceSourceType) { + this.sourceType = referenceSourceType; } public IsActive getIsActive() { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/Reference.java b/dmp-backend/core/src/main/java/eu/eudat/model/Reference.java index 53a850f09..6aff38266 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/Reference.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/Reference.java @@ -35,7 +35,7 @@ public class Reference { private String source; public static final String _source = "source"; - private ReferenceSourceType referenceSourceType; + private ReferenceSourceType sourceType; public static final String _sourceType = "sourceType"; private IsActive isActive; @@ -117,12 +117,12 @@ public class Reference { this.source = source; } - public ReferenceSourceType getReferenceSourceType() { - return referenceSourceType; + public ReferenceSourceType getSourceType() { + return sourceType; } - public void setReferenceSourceType(ReferenceSourceType referenceSourceType) { - this.referenceSourceType = referenceSourceType; + public void setSourceType(ReferenceSourceType sourceType) { + this.sourceType = sourceType; } public IsActive getIsActive() { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java index 8805531b2..c120175c6 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/ReferenceBuilder.java @@ -78,7 +78,7 @@ public class ReferenceBuilder extends BaseBuilder{ if (fields.hasField(this.asIndexer(Reference._abbreviation))) m.setAbbreviation(d.getAbbreviation()); if (fields.hasField(this.asIndexer(Reference._description))) m.setDescription(d.getDescription()); if (fields.hasField(this.asIndexer(Reference._source))) m.setSource(d.getSource()); - if (fields.hasField(this.asIndexer(Reference._sourceType))) m.setReferenceSourceType(d.getReferenceSourceType()); + if (fields.hasField(this.asIndexer(Reference._sourceType))) m.setSourceType(d.getSourceType()); if (fields.hasField(this.asIndexer(Reference._type))) m.setType(d.getType()); // if (!userInfoFields.isEmpty() && d.getCreatedBy() != null){ // //ToDo diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/DefinitionBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/DefinitionBuilder.java index 6fadedd2d..72eb77788 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/DefinitionBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/DefinitionBuilder.java @@ -18,7 +18,7 @@ import org.springframework.stereotype.Component; import java.util.*; -@Component +@Component("referencedefinitionbuilder") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) public class DefinitionBuilder extends BaseBuilder { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/FieldBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/FieldBuilder.java index da39787d2..ad9b9a9eb 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/FieldBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/referencedefinition/FieldBuilder.java @@ -18,7 +18,7 @@ import org.springframework.stereotype.Component; import java.util.*; -@Component +@Component("referencedefinitionfieldbuilder") @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) public class FieldBuilder extends BaseBuilder { diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/persist/ReferencePersist.java b/dmp-backend/core/src/main/java/eu/eudat/model/persist/ReferencePersist.java index 066a631ea..29250acd6 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/persist/ReferencePersist.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/persist/ReferencePersist.java @@ -44,7 +44,7 @@ public class ReferencePersist { private String source; @ValidEnum(message = "{validation.empty}") - private ReferenceSourceType referenceSourceType; + private ReferenceSourceType sourceType; //private UserInfoPersist createdBy; ToDo @@ -113,11 +113,11 @@ public class ReferencePersist { this.source = source; } - public ReferenceSourceType getReferenceSourceType() { - return referenceSourceType; + public ReferenceSourceType getSourceType() { + return sourceType; } - public void setReferenceSourceType(ReferenceSourceType referenceSourceType) { - this.referenceSourceType = referenceSourceType; + public void setSourceType(ReferenceSourceType sourceType) { + this.sourceType = sourceType; } } diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/ReferenceQuery.java b/dmp-backend/core/src/main/java/eu/eudat/query/ReferenceQuery.java index 8bb09948d..c2503d74a 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/query/ReferenceQuery.java +++ b/dmp-backend/core/src/main/java/eu/eudat/query/ReferenceQuery.java @@ -73,17 +73,17 @@ public class ReferenceQuery extends QueryBase { return this; } - public ReferenceQuery referenceTypes(ReferenceType value) { + public ReferenceQuery types(ReferenceType value) { this.referenceTypes = List.of(value); return this; } - public ReferenceQuery referenceTypes(ReferenceType... value) { + public ReferenceQuery types(ReferenceType... value) { this.referenceTypes = Arrays.asList(value); return this; } - public ReferenceQuery referenceTypes(Collection values) { + public ReferenceQuery types(Collection values) { this.referenceTypes = values; return this; } @@ -103,17 +103,17 @@ public class ReferenceQuery extends QueryBase { return this; } - public ReferenceQuery referenceSourceTypes(ReferenceSourceType value) { + public ReferenceQuery sourceTypes(ReferenceSourceType value) { this.referenceSourceTypes = List.of(value); return this; } - public ReferenceQuery referenceSourceTypes(ReferenceSourceType... value) { + public ReferenceQuery sourceTypes(ReferenceSourceType... value) { this.referenceSourceTypes = Arrays.asList(value); return this; } - public ReferenceQuery referenceSourceTypes(Collection values) { + public ReferenceQuery sourceTypes(Collection values) { this.referenceSourceTypes = values; return this; } @@ -204,7 +204,7 @@ public class ReferenceQuery extends QueryBase { item.setAbbreviation(QueryBase.convertSafe(tuple, columns, ReferenceEntity._abbreviation, String.class)); item.setReference(QueryBase.convertSafe(tuple, columns, ReferenceEntity._reference, String.class)); item.setSource(QueryBase.convertSafe(tuple, columns, ReferenceEntity._source, String.class)); - item.setReferenceSourceType(QueryBase.convertSafe(tuple, columns, ReferenceEntity._sourceType, ReferenceSourceType.class)); + item.setSourceType(QueryBase.convertSafe(tuple, columns, ReferenceEntity._sourceType, ReferenceSourceType.class)); item.setType(QueryBase.convertSafe(tuple, columns, ReferenceEntity._type, ReferenceType.class)); item.setCreatedBy(QueryBase.convertSafe(tuple, columns, ReferenceEntity._createdBy, UUID.class)); return item; diff --git a/dmp-backend/core/src/main/java/eu/eudat/query/lookup/ReferenceLookup.java b/dmp-backend/core/src/main/java/eu/eudat/query/lookup/ReferenceLookup.java index 9566e6254..5891d734c 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/query/lookup/ReferenceLookup.java +++ b/dmp-backend/core/src/main/java/eu/eudat/query/lookup/ReferenceLookup.java @@ -17,9 +17,9 @@ public class ReferenceLookup extends Lookup { private List isActive; - private Collection referenceSourceTypes; + private Collection sourceTypes; - private Collection referenceTypes; + private Collection types; private List ids; @@ -57,28 +57,28 @@ public class ReferenceLookup extends Lookup { this.excludedIds = excludeIds; } - public Collection getReferenceSourceTypes() { - return referenceSourceTypes; + public Collection getSourceTypes() { + return sourceTypes; } - public void setReferenceSourceTypes(Collection referenceSourceTypes) { - this.referenceSourceTypes = referenceSourceTypes; + public void setSourceTypes(Collection sourceTypes) { + this.sourceTypes = sourceTypes; } - public Collection getReferenceTypes() { - return referenceTypes; + public Collection getTypes() { + return types; } - public void setReferenceTypes(Collection referenceTypes) { - this.referenceTypes = referenceTypes; + public void setTypes(Collection types) { + this.types = types; } public ReferenceQuery enrich(QueryFactory queryFactory) { ReferenceQuery query = queryFactory.query(ReferenceQuery.class); if (this.like != null) query.like(this.like); if (this.isActive != null) query.isActive(this.isActive); - if (this.referenceTypes != null) query.referenceTypes(this.referenceTypes); - if (this.referenceSourceTypes != null) query.referenceSourceTypes(this.referenceSourceTypes); + if (this.types != null) query.types(this.types); + if (this.sourceTypes != null) query.sourceTypes(this.sourceTypes); if (this.ids != null) query.ids(this.ids); if (this.excludedIds != null) query.excludedIds(this.excludedIds); diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java index 77955edbb..4a2f05870 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/references/ReferenceService.java @@ -127,7 +127,7 @@ public class ReferenceService { data.setReference(model.getReference()); data.setAbbreviation(model.getAbbreviation()); data.setSource(model.getSource()); - data.setReferenceSourceType(model.getReferenceSourceType()); + data.setSourceType(model.getSourceType()); if (isUpdate) this.entityManager.merge(data); else this.entityManager.persist(data);