Renamed DMP -> Dmp to be consistent with the other entities
This commit is contained in:
parent
10df3db7aa
commit
61f2810fcc
|
@ -4,13 +4,13 @@ import eu.eudat.data.converters.enums.DatabaseEnum;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public enum DMPStatus implements DatabaseEnum<Short> {
|
public enum DmpStatus implements DatabaseEnum<Short> {
|
||||||
|
|
||||||
ACTIVE((short) 0), FINALISED((short) 1),DELETED((short) 99);
|
ACTIVE((short) 0), FINALISED((short) 1),DELETED((short) 99);
|
||||||
|
|
||||||
private final Short value;
|
private final Short value;
|
||||||
|
|
||||||
DMPStatus(Short value) {
|
DmpStatus(Short value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ public enum DMPStatus implements DatabaseEnum<Short> {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Map<Short, DMPStatus> map = EnumUtils.getEnumValueMap(DMPStatus.class);
|
private static final Map<Short, DmpStatus> map = EnumUtils.getEnumValueMap(DmpStatus.class);
|
||||||
|
|
||||||
public static DMPStatus of(Short i) {
|
public static DmpStatus of(Short i) {
|
||||||
return map.get(i);
|
return map.get(i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.eudat.data;
|
package eu.eudat.data;
|
||||||
|
|
||||||
import eu.eudat.commons.enums.DMPStatus;
|
import eu.eudat.commons.enums.DmpStatus;
|
||||||
import eu.eudat.commons.enums.IsActive;
|
import eu.eudat.commons.enums.IsActive;
|
||||||
import eu.eudat.data.converters.DateToUTCConverter;
|
import eu.eudat.data.converters.DateToUTCConverter;
|
||||||
import eu.eudat.data.converters.enums.IsActiveConverter;
|
import eu.eudat.data.converters.enums.IsActiveConverter;
|
||||||
|
@ -13,7 +13,7 @@ import java.util.UUID;
|
||||||
//TODO: (thgiannos) Wire up when all other dependent entities are refactored
|
//TODO: (thgiannos) Wire up when all other dependent entities are refactored
|
||||||
//@Entity
|
//@Entity
|
||||||
//@Table(name = "\"DMP\"")
|
//@Table(name = "\"DMP\"")
|
||||||
public class DMPEntity {
|
public class DmpEntity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
|
@ -35,7 +35,7 @@ public class DMPEntity {
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
@Column(name = "status", nullable = false)
|
@Column(name = "status", nullable = false)
|
||||||
private DMPStatus status;
|
private DmpStatus status;
|
||||||
|
|
||||||
public static final String _status = "status";
|
public static final String _status = "status";
|
||||||
|
|
||||||
|
@ -182,11 +182,11 @@ public class DMPEntity {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPStatus getStatus() {
|
public DmpStatus getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(DMPStatus status) {
|
public void setStatus(DmpStatus status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
package eu.eudat.data.converters.enums;
|
|
||||||
|
|
||||||
import eu.eudat.commons.enums.DMPStatus;
|
|
||||||
import jakarta.persistence.Converter;
|
|
||||||
|
|
||||||
@Converter
|
|
||||||
public class DMPStatusConverter extends DatabaseEnumConverter<DMPStatus, Short> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected DMPStatus of(Short i) {
|
|
||||||
return DMPStatus.of(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package eu.eudat.data.converters.enums;
|
||||||
|
|
||||||
|
import eu.eudat.commons.enums.DmpStatus;
|
||||||
|
import jakarta.persistence.Converter;
|
||||||
|
|
||||||
|
@Converter
|
||||||
|
public class DmpStatusConverter extends DatabaseEnumConverter<DmpStatus, Short> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected DmpStatus of(Short i) {
|
||||||
|
return DmpStatus.of(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,12 +1,12 @@
|
||||||
package eu.eudat.model;
|
package eu.eudat.model;
|
||||||
|
|
||||||
import eu.eudat.commons.enums.DMPStatus;
|
import eu.eudat.commons.enums.DmpStatus;
|
||||||
import eu.eudat.commons.enums.IsActive;
|
import eu.eudat.commons.enums.IsActive;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class DMP {
|
public class Dmp {
|
||||||
|
|
||||||
private UUID id;
|
private UUID id;
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ public class DMP {
|
||||||
|
|
||||||
public static final String _version = "version";
|
public static final String _version = "version";
|
||||||
|
|
||||||
private DMPStatus status;
|
private DmpStatus status;
|
||||||
|
|
||||||
public static final String _status = "status";
|
public static final String _status = "status";
|
||||||
|
|
||||||
|
@ -112,11 +112,11 @@ public class DMP {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPStatus getStatus() {
|
public DmpStatus getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus(DMPStatus status) {
|
public void setStatus(DmpStatus status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ package eu.eudat.model.builder;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.convention.ConventionService;
|
import eu.eudat.convention.ConventionService;
|
||||||
import eu.eudat.data.DMPEntity;
|
import eu.eudat.data.DmpEntity;
|
||||||
import eu.eudat.model.DMP;
|
import eu.eudat.model.Dmp;
|
||||||
import gr.cite.tools.exception.MyApplicationException;
|
import gr.cite.tools.exception.MyApplicationException;
|
||||||
import gr.cite.tools.fieldset.FieldSet;
|
import gr.cite.tools.fieldset.FieldSet;
|
||||||
import gr.cite.tools.logging.DataLogEntry;
|
import gr.cite.tools.logging.DataLogEntry;
|
||||||
|
@ -18,45 +18,45 @@ import java.util.*;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
public class DMPBuilder extends BaseBuilder<DMP, DMPEntity> {
|
public class DmpBuilder extends BaseBuilder<Dmp, DmpEntity> {
|
||||||
|
|
||||||
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
private EnumSet<AuthorizationFlags> authorize = EnumSet.of(AuthorizationFlags.None);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public DMPBuilder(ConventionService conventionService) {
|
public DmpBuilder(ConventionService conventionService) {
|
||||||
super(conventionService, new LoggerService(LoggerFactory.getLogger(DMPBuilder.class)));
|
super(conventionService, new LoggerService(LoggerFactory.getLogger(DmpBuilder.class)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPBuilder authorize(EnumSet<AuthorizationFlags> values) {
|
public DmpBuilder authorize(EnumSet<AuthorizationFlags> values) {
|
||||||
this.authorize = values;
|
this.authorize = values;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DMP> build(FieldSet fields, List<DMPEntity> data) throws MyApplicationException {
|
public List<Dmp> build(FieldSet fields, List<DmpEntity> data) throws MyApplicationException {
|
||||||
this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0));
|
this.logger.debug("building for {} items requesting {} fields", Optional.ofNullable(data).map(List::size).orElse(0), Optional.ofNullable(fields).map(FieldSet::getFields).map(Set::size).orElse(0));
|
||||||
this.logger.trace(new DataLogEntry("requested fields", fields));
|
this.logger.trace(new DataLogEntry("requested fields", fields));
|
||||||
if (fields == null || data == null || fields.isEmpty())
|
if (fields == null || data == null || fields.isEmpty())
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
List<DMP> models = new ArrayList<>();
|
List<Dmp> models = new ArrayList<>();
|
||||||
for (DMPEntity d : data) {
|
for (DmpEntity d : data) {
|
||||||
DMP m = new DMP();
|
Dmp m = new Dmp();
|
||||||
if (fields.hasField(this.asIndexer(DMP._id))) m.setId(d.getId());
|
if (fields.hasField(this.asIndexer(Dmp._id))) m.setId(d.getId());
|
||||||
if (fields.hasField(this.asIndexer(DMP._label))) m.setLabel(d.getLabel());
|
if (fields.hasField(this.asIndexer(Dmp._label))) m.setLabel(d.getLabel());
|
||||||
if (fields.hasField(this.asIndexer(DMP._version))) m.setVersion(d.getVersion());
|
if (fields.hasField(this.asIndexer(Dmp._version))) m.setVersion(d.getVersion());
|
||||||
if (fields.hasField(this.asIndexer(DMP._status))) m.setStatus(d.getStatus());
|
if (fields.hasField(this.asIndexer(Dmp._status))) m.setStatus(d.getStatus());
|
||||||
if (fields.hasField(this.asIndexer(DMP._properties))) m.setProperties(d.getProperties());
|
if (fields.hasField(this.asIndexer(Dmp._properties))) m.setProperties(d.getProperties());
|
||||||
if (fields.hasField(this.asIndexer(DMP._dmpProperties))) m.setDmpProperties(d.getDmpProperties());
|
if (fields.hasField(this.asIndexer(Dmp._dmpProperties))) m.setDmpProperties(d.getDmpProperties());
|
||||||
if (fields.hasField(this.asIndexer(DMP._groupId))) m.setGroupId(d.getGroupId());
|
if (fields.hasField(this.asIndexer(Dmp._groupId))) m.setGroupId(d.getGroupId());
|
||||||
if (fields.hasField(this.asIndexer(DMP._description))) m.setDescription(d.getDescription());
|
if (fields.hasField(this.asIndexer(Dmp._description))) m.setDescription(d.getDescription());
|
||||||
if (fields.hasField(this.asIndexer(DMP._isPublic))) m.setIsPublic(d.getIsPublic());
|
if (fields.hasField(this.asIndexer(Dmp._isPublic))) m.setIsPublic(d.getIsPublic());
|
||||||
if (fields.hasField(this.asIndexer(DMP._extraProperties))) m.setExtraProperties(d.getExtraProperties());
|
if (fields.hasField(this.asIndexer(Dmp._extraProperties))) m.setExtraProperties(d.getExtraProperties());
|
||||||
if (fields.hasField(this.asIndexer(DMP._createdAt))) m.setCreatedAt(d.getCreatedAt());
|
if (fields.hasField(this.asIndexer(Dmp._createdAt))) m.setCreatedAt(d.getCreatedAt());
|
||||||
if (fields.hasField(this.asIndexer(DMP._updatedAt))) m.setUpdatedAt(d.getUpdatedAt());
|
if (fields.hasField(this.asIndexer(Dmp._updatedAt))) m.setUpdatedAt(d.getUpdatedAt());
|
||||||
if (fields.hasField(this.asIndexer(DMP._isActive))) m.setIsActive(d.getIsActive());
|
if (fields.hasField(this.asIndexer(Dmp._isActive))) m.setIsActive(d.getIsActive());
|
||||||
if (fields.hasField(this.asIndexer(DMP._finalizedAt))) m.setFinalizedAt(d.getFinalizedAt());
|
if (fields.hasField(this.asIndexer(Dmp._finalizedAt))) m.setFinalizedAt(d.getFinalizedAt());
|
||||||
if (fields.hasField(this.asIndexer(DMP._publishedAt))) m.setPublishedAt(d.getPublishedAt());
|
if (fields.hasField(this.asIndexer(Dmp._publishedAt))) m.setPublishedAt(d.getPublishedAt());
|
||||||
if (fields.hasField(this.asIndexer(DMP._hash))) m.setHash(this.hashValue(d.getUpdatedAt()));
|
if (fields.hasField(this.asIndexer(Dmp._hash))) m.setHash(this.hashValue(d.getUpdatedAt()));
|
||||||
models.add(m);
|
models.add(m);
|
||||||
}
|
}
|
||||||
this.logger.debug("build {} items", Optional.of(models).map(List::size).orElse(0));
|
this.logger.debug("build {} items", Optional.of(models).map(List::size).orElse(0));
|
|
@ -1,5 +1,5 @@
|
||||||
package eu.eudat.model.censorship;
|
package eu.eudat.model.censorship;
|
||||||
|
|
||||||
public class DMPCensor {
|
public class DmpCensor {
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
package eu.eudat.model.deleter;
|
package eu.eudat.model.deleter;
|
||||||
|
|
||||||
public class DMPDeleter {
|
public class DmpDeleter {
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
package eu.eudat.model.persist;
|
package eu.eudat.model.persist;
|
||||||
|
|
||||||
public class DMPPersist {
|
public class DmpPersist {
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
package eu.eudat.query;
|
package eu.eudat.query;
|
||||||
|
|
||||||
import eu.eudat.authorization.AuthorizationFlags;
|
import eu.eudat.authorization.AuthorizationFlags;
|
||||||
import eu.eudat.commons.enums.DMPStatus;
|
import eu.eudat.commons.enums.DmpStatus;
|
||||||
import eu.eudat.commons.enums.IsActive;
|
import eu.eudat.commons.enums.IsActive;
|
||||||
import eu.eudat.commons.scope.user.UserScope;
|
import eu.eudat.commons.scope.user.UserScope;
|
||||||
import eu.eudat.data.DMPEntity;
|
import eu.eudat.data.DmpEntity;
|
||||||
import eu.eudat.model.DMP;
|
import eu.eudat.model.Dmp;
|
||||||
import gr.cite.commons.web.authz.service.AuthorizationService;
|
import gr.cite.commons.web.authz.service.AuthorizationService;
|
||||||
import gr.cite.tools.data.query.FieldResolver;
|
import gr.cite.tools.data.query.FieldResolver;
|
||||||
import gr.cite.tools.data.query.QueryBase;
|
import gr.cite.tools.data.query.QueryBase;
|
||||||
|
@ -22,7 +22,7 @@ import java.util.*;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||||
public class DMPQueryV2 extends QueryBase<DMPEntity> {
|
public class DmpQuery extends QueryBase<DmpEntity> {
|
||||||
|
|
||||||
private String like;
|
private String like;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ public class DMPQueryV2 extends QueryBase<DMPEntity> {
|
||||||
|
|
||||||
private Collection<IsActive> isActives;
|
private Collection<IsActive> isActives;
|
||||||
|
|
||||||
private Collection<DMPStatus> statuses;
|
private Collection<DmpStatus> statuses;
|
||||||
|
|
||||||
private Collection<UUID> excludedIds;
|
private Collection<UUID> excludedIds;
|
||||||
|
|
||||||
|
@ -40,77 +40,77 @@ public class DMPQueryV2 extends QueryBase<DMPEntity> {
|
||||||
|
|
||||||
private final AuthorizationService authService;
|
private final AuthorizationService authService;
|
||||||
|
|
||||||
public DMPQueryV2(UserScope userScope, AuthorizationService authService) {
|
public DmpQuery(UserScope userScope, AuthorizationService authService) {
|
||||||
this.userScope = userScope;
|
this.userScope = userScope;
|
||||||
this.authService = authService;
|
this.authService = authService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 like(String value) {
|
public DmpQuery like(String value) {
|
||||||
this.like = value;
|
this.like = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 ids(UUID value) {
|
public DmpQuery ids(UUID value) {
|
||||||
this.ids = List.of(value);
|
this.ids = List.of(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 ids(UUID... value) {
|
public DmpQuery ids(UUID... value) {
|
||||||
this.ids = Arrays.asList(value);
|
this.ids = Arrays.asList(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 ids(Collection<UUID> values) {
|
public DmpQuery ids(Collection<UUID> values) {
|
||||||
this.ids = values;
|
this.ids = values;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 isActive(IsActive value) {
|
public DmpQuery isActive(IsActive value) {
|
||||||
this.isActives = List.of(value);
|
this.isActives = List.of(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 isActive(IsActive... value) {
|
public DmpQuery isActive(IsActive... value) {
|
||||||
this.isActives = Arrays.asList(value);
|
this.isActives = Arrays.asList(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 isActive(Collection<IsActive> values) {
|
public DmpQuery isActive(Collection<IsActive> values) {
|
||||||
this.isActives = values;
|
this.isActives = values;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 statuses(DMPStatus value) {
|
public DmpQuery statuses(DmpStatus value) {
|
||||||
this.statuses = List.of(value);
|
this.statuses = List.of(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 statuses(DMPStatus... value) {
|
public DmpQuery statuses(DmpStatus... value) {
|
||||||
this.statuses = Arrays.asList(value);
|
this.statuses = Arrays.asList(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 statuses(Collection<DMPStatus> values) {
|
public DmpQuery statuses(Collection<DmpStatus> values) {
|
||||||
this.statuses = values;
|
this.statuses = values;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 excludedIds(Collection<UUID> values) {
|
public DmpQuery excludedIds(Collection<UUID> values) {
|
||||||
this.excludedIds = values;
|
this.excludedIds = values;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 excludedIds(UUID value) {
|
public DmpQuery excludedIds(UUID value) {
|
||||||
this.excludedIds = List.of(value);
|
this.excludedIds = List.of(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 excludedIds(UUID... value) {
|
public DmpQuery excludedIds(UUID... value) {
|
||||||
this.excludedIds = Arrays.asList(value);
|
this.excludedIds = Arrays.asList(value);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DMPQueryV2 authorize(EnumSet<AuthorizationFlags> values) {
|
public DmpQuery authorize(EnumSet<AuthorizationFlags> values) {
|
||||||
this.authorize = values;
|
this.authorize = values;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -121,37 +121,37 @@ public class DMPQueryV2 extends QueryBase<DMPEntity> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Class<DMPEntity> entityClass() {
|
protected Class<DmpEntity> entityClass() {
|
||||||
return DMPEntity.class;
|
return DmpEntity.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <X, Y> Predicate applyFilters(QueryContext<X, Y> queryContext) {
|
protected <X, Y> Predicate applyFilters(QueryContext<X, Y> queryContext) {
|
||||||
List<Predicate> predicates = new ArrayList<>();
|
List<Predicate> predicates = new ArrayList<>();
|
||||||
if (this.ids != null) {
|
if (this.ids != null) {
|
||||||
CriteriaBuilder.In<UUID> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._id));
|
CriteriaBuilder.In<UUID> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DmpEntity._id));
|
||||||
for (UUID item : this.ids)
|
for (UUID item : this.ids)
|
||||||
inClause.value(item);
|
inClause.value(item);
|
||||||
predicates.add(inClause);
|
predicates.add(inClause);
|
||||||
}
|
}
|
||||||
if (this.like != null && !this.like.isEmpty()) {
|
if (this.like != null && !this.like.isEmpty()) {
|
||||||
predicates.add(queryContext.CriteriaBuilder.like(queryContext.Root.get(DMPEntity._label), this.like));
|
predicates.add(queryContext.CriteriaBuilder.like(queryContext.Root.get(DmpEntity._label), this.like));
|
||||||
}
|
}
|
||||||
if (this.isActives != null) {
|
if (this.isActives != null) {
|
||||||
CriteriaBuilder.In<IsActive> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._isActive));
|
CriteriaBuilder.In<IsActive> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DmpEntity._isActive));
|
||||||
for (IsActive item : this.isActives)
|
for (IsActive item : this.isActives)
|
||||||
inClause.value(item);
|
inClause.value(item);
|
||||||
predicates.add(inClause);
|
predicates.add(inClause);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.statuses != null) {
|
if (this.statuses != null) {
|
||||||
CriteriaBuilder.In<DMPStatus> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._status));
|
CriteriaBuilder.In<DmpStatus> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DmpEntity._status));
|
||||||
for (DMPStatus item : this.statuses)
|
for (DmpStatus item : this.statuses)
|
||||||
inClause.value(item);
|
inClause.value(item);
|
||||||
predicates.add(inClause);
|
predicates.add(inClause);
|
||||||
}
|
}
|
||||||
if (this.excludedIds != null) {
|
if (this.excludedIds != null) {
|
||||||
CriteriaBuilder.In<UUID> notInClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DMPEntity._id));
|
CriteriaBuilder.In<UUID> notInClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DmpEntity._id));
|
||||||
for (UUID item : this.excludedIds)
|
for (UUID item : this.excludedIds)
|
||||||
notInClause.value(item);
|
notInClause.value(item);
|
||||||
predicates.add(notInClause.not());
|
predicates.add(notInClause.not());
|
||||||
|
@ -166,42 +166,42 @@ public class DMPQueryV2 extends QueryBase<DMPEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String fieldNameOf(FieldResolver item) {
|
protected String fieldNameOf(FieldResolver item) {
|
||||||
if (item.match(DMP._id)) return DMPEntity._id;
|
if (item.match(Dmp._id)) return DmpEntity._id;
|
||||||
else if (item.match(DMP._label)) return DMPEntity._label;
|
else if (item.match(Dmp._label)) return DmpEntity._label;
|
||||||
else if (item.match(DMP._version)) return DMPEntity._version;
|
else if (item.match(Dmp._version)) return DmpEntity._version;
|
||||||
else if (item.match(DMP._status)) return DMPEntity._status;
|
else if (item.match(Dmp._status)) return DmpEntity._status;
|
||||||
else if (item.match(DMP._properties)) return DMPEntity._properties;
|
else if (item.match(Dmp._properties)) return DmpEntity._properties;
|
||||||
else if (item.match(DMP._dmpProperties)) return DMPEntity._dmpProperties;
|
else if (item.match(Dmp._dmpProperties)) return DmpEntity._dmpProperties;
|
||||||
else if (item.match(DMP._groupId)) return DMPEntity._groupId;
|
else if (item.match(Dmp._groupId)) return DmpEntity._groupId;
|
||||||
else if (item.match(DMP._description)) return DMPEntity._description;
|
else if (item.match(Dmp._description)) return DmpEntity._description;
|
||||||
else if (item.match(DMP._isPublic)) return DMPEntity._isPublic;
|
else if (item.match(Dmp._isPublic)) return DmpEntity._isPublic;
|
||||||
else if (item.match(DMP._extraProperties)) return DMPEntity._extraProperties;
|
else if (item.match(Dmp._extraProperties)) return DmpEntity._extraProperties;
|
||||||
else if (item.match(DMP._createdAt)) return DMPEntity._createdAt;
|
else if (item.match(Dmp._createdAt)) return DmpEntity._createdAt;
|
||||||
else if (item.match(DMP._updatedAt)) return DMPEntity._updatedAt;
|
else if (item.match(Dmp._updatedAt)) return DmpEntity._updatedAt;
|
||||||
else if (item.match(DMP._isActive)) return DMPEntity._isActive;
|
else if (item.match(Dmp._isActive)) return DmpEntity._isActive;
|
||||||
else if (item.match(DMP._finalizedAt)) return DMPEntity._finalizedAt;
|
else if (item.match(Dmp._finalizedAt)) return DmpEntity._finalizedAt;
|
||||||
else if (item.match(DMP._publishedAt)) return DMPEntity._publishedAt;
|
else if (item.match(Dmp._publishedAt)) return DmpEntity._publishedAt;
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DMPEntity convert(Tuple tuple, Set<String> columns) {
|
protected DmpEntity convert(Tuple tuple, Set<String> columns) {
|
||||||
DMPEntity item = new DMPEntity();
|
DmpEntity item = new DmpEntity();
|
||||||
item.setId(QueryBase.convertSafe(tuple, columns, DMPEntity._id, UUID.class));
|
item.setId(QueryBase.convertSafe(tuple, columns, DmpEntity._id, UUID.class));
|
||||||
item.setLabel(QueryBase.convertSafe(tuple, columns, DMPEntity._label, String.class));
|
item.setLabel(QueryBase.convertSafe(tuple, columns, DmpEntity._label, String.class));
|
||||||
item.setVersion(QueryBase.convertSafe(tuple, columns, DMPEntity._version, Integer.class));
|
item.setVersion(QueryBase.convertSafe(tuple, columns, DmpEntity._version, Integer.class));
|
||||||
item.setStatus(QueryBase.convertSafe(tuple, columns, DMPEntity._status, DMPStatus.class));
|
item.setStatus(QueryBase.convertSafe(tuple, columns, DmpEntity._status, DmpStatus.class));
|
||||||
item.setProperties(QueryBase.convertSafe(tuple, columns, DMPEntity._properties, String.class));
|
item.setProperties(QueryBase.convertSafe(tuple, columns, DmpEntity._properties, String.class));
|
||||||
item.setDmpProperties(QueryBase.convertSafe(tuple, columns, DMPEntity._dmpProperties, String.class));
|
item.setDmpProperties(QueryBase.convertSafe(tuple, columns, DmpEntity._dmpProperties, String.class));
|
||||||
item.setGroupId(QueryBase.convertSafe(tuple, columns, DMPEntity._groupId, UUID.class));
|
item.setGroupId(QueryBase.convertSafe(tuple, columns, DmpEntity._groupId, UUID.class));
|
||||||
item.setDescription(QueryBase.convertSafe(tuple, columns, DMPEntity._description, String.class));
|
item.setDescription(QueryBase.convertSafe(tuple, columns, DmpEntity._description, String.class));
|
||||||
item.setIsPublic(QueryBase.convertSafe(tuple, columns, DMPEntity._isPublic, Boolean.class));
|
item.setIsPublic(QueryBase.convertSafe(tuple, columns, DmpEntity._isPublic, Boolean.class));
|
||||||
item.setExtraProperties(QueryBase.convertSafe(tuple, columns, DMPEntity._extraProperties, String.class));
|
item.setExtraProperties(QueryBase.convertSafe(tuple, columns, DmpEntity._extraProperties, String.class));
|
||||||
item.setCreatedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._createdAt, Instant.class));
|
item.setCreatedAt(QueryBase.convertSafe(tuple, columns, DmpEntity._createdAt, Instant.class));
|
||||||
item.setUpdatedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._updatedAt, Instant.class));
|
item.setUpdatedAt(QueryBase.convertSafe(tuple, columns, DmpEntity._updatedAt, Instant.class));
|
||||||
item.setIsActive(QueryBase.convertSafe(tuple, columns, DMPEntity._isActive, IsActive.class));
|
item.setIsActive(QueryBase.convertSafe(tuple, columns, DmpEntity._isActive, IsActive.class));
|
||||||
item.setFinalizedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._finalizedAt, Instant.class));
|
item.setFinalizedAt(QueryBase.convertSafe(tuple, columns, DmpEntity._finalizedAt, Instant.class));
|
||||||
item.setPublishedAt(QueryBase.convertSafe(tuple, columns, DMPEntity._publishedAt, Instant.class));
|
item.setPublishedAt(QueryBase.convertSafe(tuple, columns, DmpEntity._publishedAt, Instant.class));
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package eu.eudat.query.lookup;
|
package eu.eudat.query.lookup;
|
||||||
|
|
||||||
public class DMPLookup {
|
public class DmpLookup {
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +0,0 @@
|
||||||
package eu.eudat.service.dmp;
|
|
||||||
|
|
||||||
public class DMPServiceImpl implements DMPService {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
package eu.eudat.service.dmp;
|
package eu.eudat.service.dmp;
|
||||||
|
|
||||||
public interface DMPService {
|
public interface DmpService {
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package eu.eudat.service.dmp;
|
||||||
|
|
||||||
|
public class DmpServiceImpl implements DmpService {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue