Updating Spring to version 6, adding service stack for DescriptionType entity

This commit is contained in:
Thomas Georgios Giannos 2023-10-03 17:29:45 +03:00
parent 6b544e4702
commit 7c96078570
260 changed files with 2221 additions and 1097 deletions

31
dmp-backend/core/pom.xml Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>eu.eudat</groupId>
<artifactId>dmp-backend</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>core</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,43 @@
package eu.eudat.commons.enums;
public enum DescriptionTemplateTypeStatus {
SAVED((short) 0), FINALIZED((short) 1), DELETED((short) 99);
private final short value;
DescriptionTemplateTypeStatus(short value) {
this.value = value;
}
public short getValue() {
return value;
}
public static DescriptionTemplateTypeStatus fromInteger(int value) {
switch (value) {
case 0:
return SAVED;
case 1:
return FINALIZED;
case 99:
return DELETED;
default:
throw new RuntimeException("Unsupported Description Template Type Status");
}
}
public static DescriptionTemplateTypeStatus fromLabel(String value) {
switch (value) {
case "SAVED":
return SAVED;
case "FINALISED":
return FINALIZED;
case "DELETED":
return DELETED;
default:
throw new RuntimeException("Unsupported Description Template Type Status");
}
}
}

View File

@ -14,7 +14,7 @@ import java.util.UUID;
/** /**
* Currently not used * Currently not used
*/ */
public class UUIDType implements UserType { public class UUIDType implements UserType<UUID> {
private final int[] sqlTypesSupported = new int[]{Types.NUMERIC}; private final int[] sqlTypesSupported = new int[]{Types.NUMERIC};
private final String CAST_EXCEPTION_TEXT = " cannot be cast to a java.util.UUID"; private final String CAST_EXCEPTION_TEXT = " cannot be cast to a java.util.UUID";
@ -22,18 +22,27 @@ public class UUIDType implements UserType {
return sqlTypesSupported; return sqlTypesSupported;
} }
@SuppressWarnings("rawtypes") @Override
public Class returnedClass() { public int getSqlType() {
return sqlTypesSupported[0];
}
public Class<UUID> returnedClass() {
return UUID.class; return UUID.class;
} }
public boolean equals(Object x, Object y) throws HibernateException { public boolean equals(UUID x, UUID y) throws HibernateException {
if (x == null) return y == null; if (x == null) return y == null;
else return x.equals(y); else return x.equals(y);
} }
public int hashCode(Object x) throws HibernateException { public int hashCode(UUID x) throws HibernateException {
return x == null ? null : x.hashCode(); return x == null ? -1 : x.hashCode();
}
@Override
public UUID nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, Object owner) throws SQLException {
return null;
} }
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException { public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
@ -58,25 +67,24 @@ public class UUIDType implements UserType {
st.setObject(index, uuid, Types.OTHER); st.setObject(index, uuid, Types.OTHER);
} }
public Object deepCopy(Object value) throws HibernateException { public UUID deepCopy(UUID value) throws HibernateException {
if (value == null) return null; if (value == null) return null;
UUID uuid = (UUID) value; return new UUID(value.getMostSignificantBits(), value.getLeastSignificantBits());
return new UUID(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
} }
public boolean isMutable() { public boolean isMutable() {
return false; return false;
} }
public Serializable disassemble(Object value) throws HibernateException { public Serializable disassemble(UUID value) throws HibernateException {
return (Serializable) value; return value;
} }
public Object assemble(Serializable cached, Object owner) throws HibernateException { public UUID assemble(Serializable cached, Object owner) throws HibernateException {
return cached; return (UUID) cached;
} }
public Object replace(Object original, Object target, Object owner) throws HibernateException { public UUID replace(UUID original, Object target, Object owner) throws HibernateException {
return original; return original;
} }
@ -98,7 +106,7 @@ public class UUIDType implements UserType {
return nullSafeGet(rs, names, owner); return nullSafeGet(rs, names, owner);
} }
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) public void nullSafeSet(PreparedStatement st, UUID value, int index, SharedSessionContractImplementor session)
throws HibernateException, SQLException { throws HibernateException, SQLException {
nullSafeSet(st, value, index); nullSafeSet(st, value, index);
} }

View File

@ -13,7 +13,7 @@ import java.sql.Types;
/** /**
* Store and retrieve a PostgreSQL "xml" column as a Java string. * Store and retrieve a PostgreSQL "xml" column as a Java string.
*/ */
public class XMLType implements UserType { public class XMLType implements UserType<String> {
private final int[] sqlTypesSupported = new int[]{Types.VARCHAR}; private final int[] sqlTypesSupported = new int[]{Types.VARCHAR};
@ -21,11 +21,16 @@ public class XMLType implements UserType {
return sqlTypesSupported; return sqlTypesSupported;
} }
public Class returnedClass() { @Override
public int getSqlType() {
return sqlTypesSupported[0];
}
public Class<String> returnedClass() {
return String.class; return String.class;
} }
public boolean equals(Object x, Object y) throws HibernateException { public boolean equals(String x, String y) throws HibernateException {
if (x == null) { if (x == null) {
return y == null; return y == null;
} else { } else {
@ -33,8 +38,13 @@ public class XMLType implements UserType {
} }
} }
public int hashCode(Object x) throws HibernateException { public int hashCode(String x) throws HibernateException {
return x == null ? null : x.hashCode(); return x == null ? -1 : x.hashCode();
}
@Override
public String nullSafeGet(ResultSet resultSet, int i, SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws SQLException {
return null;
} }
public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException { public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
@ -51,25 +61,23 @@ public class XMLType implements UserType {
} }
} }
public Object deepCopy(Object value) throws HibernateException { public String deepCopy(String value) throws HibernateException {
if (value == null) return value;
return null;
return new String((String) value);
} }
public boolean isMutable() { public boolean isMutable() {
return false; return false;
} }
public Serializable disassemble(Object value) throws HibernateException { public Serializable disassemble(String value) throws HibernateException {
return (String) value; return value;
} }
public Object assemble(Serializable cached, Object owner) throws HibernateException { public String assemble(Serializable cached, Object owner) throws HibernateException {
return (String) cached; return (String) cached;
} }
public Object replace(Object original, Object target, Object owner) throws HibernateException { public String replace(String original, String target, Object owner) throws HibernateException {
return original; return original;
} }
@ -78,9 +86,8 @@ public class XMLType implements UserType {
return nullSafeGet(rs, names, owner); return nullSafeGet(rs, names, owner);
} }
public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException { public void nullSafeSet(PreparedStatement st, String value, int index, SharedSessionContractImplementor session) throws HibernateException, SQLException {
nullSafeSet(st, value, index); nullSafeSet(st, value, index);
} }
} }

View File

@ -0,0 +1,40 @@
package eu.eudat.convention;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.function.Function;
public interface ConventionService {
Boolean isValidId(Integer id);
Boolean isValidGuid(UUID guid);
Boolean isValidUUID(String str);
UUID parseUUIDSafe(String str);
Boolean isValidHash(String hash);
String hashValue(Object value);
String limit(String text, int maxLength);
String truncate(String text, int maxLength);
UUID getEmptyUUID();
boolean isNullOrEmpty(String value);
boolean isListNullOrEmpty(List<?> value);
String stringEmpty();
String asPrefix(String name);
String asIndexerPrefix(String part);
String asIndexer(String... names);
<K, V> Map<K, List<V>> toDictionaryOfList(List<V> items, Function<V, K> keySelector);
}

View File

@ -0,0 +1,150 @@
package eu.eudat.convention;
import eu.eudat.errorcode.ErrorThesaurusProperties;
import gr.cite.tools.exception.MyApplicationException;
import gr.cite.tools.logging.LoggerService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.time.Instant;
import java.util.*;
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Component
@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON)
public class ConventionServiceImpl implements ConventionService {
private final static Pattern UUID_REGEX_PATTERN = Pattern.compile("^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$");
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(ConventionServiceImpl.class));
private final ErrorThesaurusProperties errors;
@Autowired
public ConventionServiceImpl(ErrorThesaurusProperties errors) {
this.errors = errors;
}
@Override
public Boolean isValidId(Integer id) {
return id != null && id > 0;
}
@Override
public Boolean isValidGuid(UUID guid) {
return guid != null && !guid.equals(this.getEmptyUUID());
}
@Override
public Boolean isValidUUID(String str) {
if (this.isNullOrEmpty(str)) {
return false;
}
return UUID_REGEX_PATTERN.matcher(str).matches();
}
@Override
public UUID parseUUIDSafe(String str) {
if (!this.isValidUUID(str)) {
return null;
}
try {
return UUID.fromString(str);
} catch (Exception ex){
logger.warn("invalid uuid" + str, ex);
return null;
}
}
@Override
public Boolean isValidHash(String hash) {
return !this.isNullOrEmpty(hash);
}
@Override
public String hashValue(Object value) throws MyApplicationException {
if (value == null) return this.stringEmpty();
if (value instanceof Instant) return String.format("%ts", (Instant) value);
throw new MyApplicationException(this.errors.getSystemError().getCode(), this.errors.getSystemError().getMessage());
}
@Override
public String limit(String text, int maxLength) {
if (this.isNullOrEmpty(text)) return text;
if (text.length() > maxLength) return String.format("%s...", text.substring(0, maxLength));
else return text;
}
@Override
public String truncate(String text, int maxLength) {
String truncated = text;
if (text.length() < maxLength) return text;
truncated = truncated.trim();
truncated = truncated.replaceAll("\\s+", " ");//remove multiple spaces
if (truncated.length() < maxLength) return truncated;
truncated = truncated.replaceAll("([.!@#$%^&-=':;,<>?*\"/|])+", "");//remove multiple spaces
if (truncated.length() < maxLength) return truncated;
truncated = truncated.replaceAll("([aeiou])+", "");//remove multiple spaces
if (truncated.length() < maxLength) return truncated;
truncated = truncated.replaceAll("([AEIOU])+", "");//remove multiple spaces
if (truncated.length() < maxLength) return truncated;
if (text.length() > maxLength) return String.format("%s...", text.substring(0, maxLength));
return text;
}
@Override
public UUID getEmptyUUID() {
return new UUID(0L, 0L);
}
@Override
public boolean isNullOrEmpty(String value) {
return value == null || value.isEmpty();
}
@Override
public boolean isListNullOrEmpty(List<?> value) {
if(value == null) return true;
return value.isEmpty();
}
@Override
public String stringEmpty() {
return "";
}
@Override
public String asPrefix(String name) {
if (name == null) return null;
return name + ".";
}
@Override
public String asIndexer(String... names) {
if (names == null) return null;
return String.join(".", Arrays.stream(names).filter(x -> !this.isNullOrEmpty(x)).collect(Collectors.toList()));
}
@Override
public String asIndexerPrefix(String part) {
if (part == null) return null;
return part + ".";
}
@Override
public <K, V> Map<K, List<V>> toDictionaryOfList(List<V> items, Function<V, K> keySelector) {
Map<K, List<V>> map = new HashMap<>();
for (V model : items) {
K key = keySelector.apply(model);
if (!map.containsKey(key)) map.put(key, new ArrayList<V>());
map.get(key).add(model);
}
return map;
}
}

View File

@ -0,0 +1,5 @@
package eu.eudat.data;
public interface BaseEntity {
}

View File

@ -0,0 +1,54 @@
package eu.eudat.data;
import org.hibernate.annotations.GenericGenerator;
import jakarta.persistence.*;
import java.util.UUID;
@Entity
@Table(name = "DescriptionTemplateType")
public class DescriptionTemplateTypeEntity implements BaseEntity {
@Id
@GeneratedValue
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "ID", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id;
public static final String _id = "ID";
@Column(name = "Name", nullable = false)
private String name;
public static final String _name = "Name";
@Column(name = "Status", nullable = false)
private Short status;
public static final String _status = "Status";
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Short getStatus() {
return status;
}
public void setStatus(Short status) {
this.status = status;
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.errorcode;
public class ErrorDescription {
private int code;
private String message;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@ -0,0 +1,12 @@
package eu.eudat.errorcode;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(ErrorThesaurusProperties.class)
public class ErrorThesaurusConfiguration {
}

View File

@ -0,0 +1,48 @@
package eu.eudat.errorcode;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "error-thesaurus")
public class ErrorThesaurusProperties {
private ErrorDescription systemError;
public ErrorDescription getSystemError() {
return systemError;
}
public void setSystemError(ErrorDescription systemError) {
this.systemError = systemError;
}
private ErrorDescription forbidden;
public ErrorDescription getForbidden() {
return forbidden;
}
public void setForbidden(ErrorDescription forbidden) {
this.forbidden = forbidden;
}
private ErrorDescription hashConflict;
public ErrorDescription getHashConflict() {
return hashConflict;
}
public void setHashConflict(ErrorDescription hashConflict) {
this.hashConflict = hashConflict;
}
private ErrorDescription modelValidation;
public ErrorDescription getModelValidation() {
return modelValidation;
}
public void setModelValidation(ErrorDescription modelValidation) {
this.modelValidation = modelValidation;
}
}

View File

@ -0,0 +1,37 @@
package eu.eudat.model;
import java.util.UUID;
public class DescriptionTemplateType {
private UUID id;
private String name;
private short status;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public short getStatus() {
return status;
}
public void setStatus(short status) {
this.status = status;
}
}

View File

@ -0,0 +1,97 @@
package eu.eudat.model.builder;
import eu.eudat.convention.ConventionService;
import gr.cite.tools.data.builder.Builder;
import gr.cite.tools.data.query.QueryBase;
import gr.cite.tools.fieldset.BaseFieldSet;
import gr.cite.tools.fieldset.FieldSet;
import gr.cite.tools.logging.LoggerService;
import java.time.Instant;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
public abstract class BaseBuilder<M, D> implements Builder {
protected final LoggerService logger;
protected final ConventionService conventionService;
public BaseBuilder(
ConventionService conventionService,
LoggerService logger
) {
this.conventionService = conventionService;
this.logger = logger;
}
public M build(FieldSet directives, D data) {
if (data == null) {
return null;
}
List<M> models = this.build(directives == null ? getFullFieldSet() : directives, List.of(data));
return models.stream().findFirst().orElse(null);
}
public abstract List<M> build(FieldSet directives, List<D> data);
public abstract FieldSet getFullFieldSet();
public <K> Map<K, M> asForeignKey(QueryBase<D> query, FieldSet directives, Function<M, K> keySelector) {
this.logger.trace("Building references from query");
List<D> data = query.collectAs(directives);
this.logger.trace("collected {} items to build", Optional.ofNullable(data).map(List::size).orElse(0));
return this.asForeignKey(data, directives, keySelector);
}
public <K> Map<K, M> asForeignKey(List<D> data, FieldSet directives, Function<M, K> keySelector) {
this.logger.trace("building references");
List<M> models = this.build(directives, data);
this.logger.trace("mapping {} build items from {} requested", Optional.ofNullable(models).map(List::size).orElse(0), Optional.ofNullable(data).map(List::size).orElse(0));
assert models != null;
return models.stream().collect(Collectors.toMap(keySelector, o -> o));
}
public <K> Map<K, List<M>> asMasterKey(QueryBase<D> query, FieldSet directives, Function<M, K> keySelector) {
this.logger.trace("Building details from query");
List<D> data = query.collectAs(directives);
this.logger.trace("collected {} items to build", Optional.ofNullable(data).map(List::size).orElse(0));
return this.asMasterKey(data, directives, keySelector);
}
public <K> Map<K, List<M>> asMasterKey(List<D> data, FieldSet directives, Function<M, K> keySelector) {
this.logger.trace("building details");
List<M> models = this.build(directives, data);
this.logger.trace("mapping {} build items from {} requested", Optional.ofNullable(models).map(List::size).orElse(0), Optional.ofNullable(data).map(List::size).orElse(0));
Map<K, List<M>> map = new HashMap<>();
assert models != null;
for (M model : models) {
K key = keySelector.apply(model);
if (!map.containsKey(key))
map.put(key, new ArrayList<M>());
map.get(key).add(model);
}
return map;
}
public <FK, FM> Map<FK, FM> asEmpty(List<FK> keys, Function<FK, FM> mapper, Function<FM, FK> keySelector) {
this.logger.trace("building static references");
List<FM> models = keys.stream().map(mapper).collect(Collectors.toList());
this.logger.trace("mapping {} build items from {} requested", Optional.of(models).map(List::size).orElse(0), Optional.of(keys).map(List::size));
return models.stream().collect(Collectors.toMap(keySelector, o -> o));
}
protected String hashValue(Instant value) {
return this.conventionService.hashValue(value);
}
protected String asPrefix(String name) {
return this.conventionService.asPrefix(name);
}
protected String asIndexer(String... names) {
return this.conventionService.asIndexer(names);
}
}

View File

@ -0,0 +1,56 @@
package eu.eudat.model.builder;
import eu.eudat.convention.ConventionService;
import eu.eudat.data.DescriptionTemplateTypeEntity;
import eu.eudat.model.DescriptionTemplateType;
import gr.cite.tools.fieldset.BaseFieldSet;
import gr.cite.tools.fieldset.FieldSet;
import gr.cite.tools.logging.LoggerService;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@Component
public class DescriptionTemplateTypeBuilder extends BaseBuilder<DescriptionTemplateType, DescriptionTemplateTypeEntity> {
public DescriptionTemplateTypeBuilder(ConventionService conventionService) {
super(conventionService, new LoggerService(LoggerFactory.getLogger(DescriptionTemplateTypeBuilder.class)));
}
@Override
public List<DescriptionTemplateType> build(FieldSet directives, List<DescriptionTemplateTypeEntity> data) {
if (directives == null || directives.isEmpty())
return new ArrayList<>();
List<DescriptionTemplateType> models = new ArrayList<>(100);
if (data == null)
return models;
for (DescriptionTemplateTypeEntity d : data) {
DescriptionTemplateType m = new DescriptionTemplateType();
if (directives.hasField(this.asIndexer(DescriptionTemplateTypeEntity._id)))
m.setId(d.getId());
if (directives.hasField(this.asIndexer(DescriptionTemplateTypeEntity._name)))
m.setName(d.getName());
if (directives.hasField(this.asIndexer(DescriptionTemplateTypeEntity._status)))
m.setStatus(d.getStatus());
models.add(m);
}
return models;
}
@Override
public FieldSet getFullFieldSet() {
BaseFieldSet fieldSet = new BaseFieldSet();
fieldSet.setFields(Set.of(
DescriptionTemplateTypeEntity._id,
DescriptionTemplateTypeEntity._name,
DescriptionTemplateTypeEntity._status
));
return fieldSet;
}
}

View File

@ -0,0 +1,71 @@
package eu.eudat.model.result;
import java.util.ArrayList;
import java.util.List;
public class QueryResult<M> {
public QueryResult() {
}
public QueryResult(List<M> items, long count, long countOverride) {
this.items = items;
this.count = count;
this.countOverride = countOverride;
}
public QueryResult(List<M> items, long count) {
this.items = items;
this.count = count;
this.countOverride = 0;
}
public QueryResult(M item) {
this.items = List.of(item);
this.count = 1;
this.countOverride = 0;
}
public QueryResult(List<M> items) {
this.items = items;
if (items != null)
this.count = items.size();
else
this.count = 0;
}
private List<M> items;
private long count;
private long countOverride;
public List<M> getItems() {
return items;
}
public void setItems(List<M> items) {
this.items = items;
}
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public long getCountOverride() {
return countOverride;
}
public void setCountOverride(long countOverride) {
this.countOverride = countOverride;
}
public static QueryResult<?> empty() {
return new QueryResult<>(new ArrayList<>(), 0L);
}
}

View File

@ -0,0 +1,132 @@
package eu.eudat.query;
import eu.eudat.commons.enums.DescriptionTemplateTypeStatus;
import eu.eudat.data.DescriptionTemplateTypeEntity;
import eu.eudat.query.lookup.DescriptionTemplateTypeLookup;
import eu.eudat.query.lookup.LookupAware;
import gr.cite.tools.data.query.FieldResolver;
import gr.cite.tools.data.query.QueryBase;
import gr.cite.tools.data.query.QueryContext;
import jakarta.persistence.Tuple;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.Predicate;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.*;
@Component
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class DescriptionTemplateTypeQuery extends QueryBase<DescriptionTemplateTypeEntity> implements LookupAware<DescriptionTemplateTypeQuery, DescriptionTemplateTypeLookup> {
private Collection<UUID> ids;
private Collection<String> names;
private Collection<Short> statuses;
public DescriptionTemplateTypeQuery ids(UUID value) {
this.ids = List.of(value);
return this;
}
public DescriptionTemplateTypeQuery ids(UUID... value) {
this.ids = Arrays.asList(value);
return this;
}
public DescriptionTemplateTypeQuery ids(List<UUID> value) {
this.ids = value;
return this;
}
public DescriptionTemplateTypeQuery names(String value) {
this.names = List.of(value);
return this;
}
public DescriptionTemplateTypeQuery names(String... value) {
this.names = Arrays.asList(value);
return this;
}
public DescriptionTemplateTypeQuery names(List<String> value) {
this.names = value;
return this;
}
public DescriptionTemplateTypeQuery statuses(Short value) {
this.statuses = List.of(value);
return this;
}
public DescriptionTemplateTypeQuery statuses(Short... value) {
this.statuses = Arrays.asList(value);
return this;
}
public DescriptionTemplateTypeQuery statuses(List<Short> value) {
this.statuses = value;
return this;
}
@Override
public DescriptionTemplateTypeQuery fromLookup(DescriptionTemplateTypeLookup lookup) {
if (lookup == null) return this;
if (lookup.getName() != null) names(lookup.getName());
if (lookup.getStatus() != null) statuses(DescriptionTemplateTypeStatus.fromLabel(lookup.getStatus()).getValue());
return this;
}
@Override
protected Boolean isFalseQuery() {
return Boolean.FALSE;
}
@Override
protected Class<DescriptionTemplateTypeEntity> entityClass() {
return DescriptionTemplateTypeEntity.class;
}
@Override
protected <X, Y> Predicate applyFilters(QueryContext<X, Y> queryContext) {
List<Predicate> predicates = new ArrayList<>();
if (this.ids != null) {
CriteriaBuilder.In<UUID> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DescriptionTemplateTypeEntity._id));
for (UUID item : this.ids) inClause.value(item);
predicates.add(inClause);
}
if (this.names != null) {
CriteriaBuilder.In<String> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DescriptionTemplateTypeEntity._name));
for (String item : this.names) inClause.value(item);
predicates.add(inClause);
}
if (this.statuses != null) {
CriteriaBuilder.In<Short> inClause = queryContext.CriteriaBuilder.in(queryContext.Root.get(DescriptionTemplateTypeEntity._status));
for (Short item : this.statuses) inClause.value(item);
predicates.add(inClause);
}
if (!predicates.isEmpty()) {
Predicate[] predicatesArray = predicates.toArray(new Predicate[0]);
return queryContext.CriteriaBuilder.and(predicatesArray);
} else {
return queryContext.CriteriaBuilder.and();
}
}
@Override
protected String fieldNameOf(FieldResolver item) {
return null;
}
@Override
protected DescriptionTemplateTypeEntity convert(Tuple tuple, Set<String> columns) {
return null;
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.query.lookup;
import gr.cite.tools.data.query.Lookup;
public class DescriptionTemplateTypeLookup extends Lookup {
private String name, status;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}

View File

@ -0,0 +1,12 @@
package eu.eudat.query.lookup;
public interface LookupAware<Q, L> {
/**
* Every query that supports building from a lookup object should implement this interface
* @param lookup The object containing all the lookup options
* @return The query built from all the set options
*/
Q fromLookup(L lookup);
}

View File

@ -0,0 +1,101 @@
package eu.eudat.service;
import eu.eudat.commons.enums.DescriptionTemplateTypeStatus;
import eu.eudat.data.DescriptionTemplateTypeEntity;
import eu.eudat.model.DescriptionTemplateType;
import eu.eudat.model.builder.DescriptionTemplateTypeBuilder;
import eu.eudat.query.DescriptionTemplateTypeQuery;
import eu.eudat.query.lookup.DescriptionTemplateTypeLookup;
import gr.cite.tools.data.builder.BuilderFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import java.util.List;
import java.util.UUID;
@Service
public class DescriptionTemplateTypeService {
private final ApplicationContext applicationContext;
private final BuilderFactory builderFactory;
private final PlatformTransactionManager transactionManager;
@PersistenceContext
private EntityManager entityManager;
public DescriptionTemplateTypeService(ApplicationContext applicationContext, BuilderFactory builderFactory, PlatformTransactionManager platformTransactionManager) {
this.applicationContext = applicationContext;
this.builderFactory = builderFactory;
this.transactionManager = platformTransactionManager;
}
public List<DescriptionTemplateType> getAll(DescriptionTemplateTypeLookup lookup) {
DescriptionTemplateTypeQuery query = applicationContext.getBean(DescriptionTemplateTypeQuery.class);
return builderFactory
.builder(DescriptionTemplateTypeBuilder.class)
.build(lookup.getProject(), query.fromLookup(lookup).collect());
}
public DescriptionTemplateType getById(UUID id) {
DescriptionTemplateTypeQuery query = applicationContext.getBean(DescriptionTemplateTypeQuery.class);
return builderFactory
.builder(DescriptionTemplateTypeBuilder.class)
.build(null, query.ids(id).first());
}
public DescriptionTemplateType create(DescriptionTemplateType payload) {
DescriptionTemplateTypeEntity created = new DescriptionTemplateTypeEntity();
created.setId(UUID.randomUUID());
created.setName(payload.getName());
created.setStatus(DescriptionTemplateTypeStatus.SAVED.getValue());
DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
definition.setName(UUID.randomUUID().toString());
definition.setIsolationLevel(TransactionDefinition.ISOLATION_READ_COMMITTED);
definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
TransactionStatus status = null;
try {
status = transactionManager.getTransaction(definition);
entityManager.persist(created);
entityManager.flush();
transactionManager.commit(status);
} catch (Exception ex) {
if (status != null)
transactionManager.rollback(status);
throw ex;
}
DescriptionTemplateTypeQuery query = applicationContext.getBean(DescriptionTemplateTypeQuery.class);
return builderFactory
.builder(DescriptionTemplateTypeBuilder.class)
.build(null, query.ids(created.getId()).first());
}
public DescriptionTemplateType update(DescriptionTemplateType payload) {
DescriptionTemplateTypeEntity entity = entityManager.find(DescriptionTemplateTypeEntity.class, payload.getId());
entity.setName(payload.getName());
entity.setStatus(payload.getStatus());
entityManager.merge(entity);
entityManager.flush();
return builderFactory.builder(DescriptionTemplateTypeBuilder.class).build(null, entity);
}
public boolean delete (UUID id) {
DescriptionTemplateTypeEntity entity = entityManager.find(DescriptionTemplateTypeEntity.class, id);
if (entity == null) return false;
entity.setStatus(DescriptionTemplateTypeStatus.DELETED.getValue());
entityManager.merge(entity);
entityManager.flush();
return true;
}
}

View File

@ -15,6 +15,13 @@
</parent> </parent>
<dependencies> <dependencies>
<dependency>
<groupId>eu.eudat</groupId>
<artifactId>core</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>dmp-backend</groupId> <groupId>dmp-backend</groupId>
<artifactId>queryable</artifactId> <artifactId>queryable</artifactId>

View File

@ -4,8 +4,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.format.datetime.DateFormatter; import org.springframework.format.datetime.DateFormatter;
import javax.persistence.AttributeConverter; import jakarta.persistence.AttributeConverter;
import javax.persistence.Converter; import jakarta.persistence.Converter;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;

View File

@ -8,9 +8,9 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.persistence.EntityManager; import jakarta.persistence.EntityManager;
import javax.persistence.EntityManagerFactory; import jakarta.persistence.EntityManagerFactory;
import javax.persistence.PersistenceContext; import jakarta.persistence.PersistenceContext;
@Repository("databaseCtx") @Repository("databaseCtx")

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.transaction.Transactional; import jakarta.transaction.Transactional;
import java.util.Set; import java.util.Set;

View File

@ -10,13 +10,13 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField; import eu.eudat.queryable.types.SelectionField;
import eu.eudat.types.grant.GrantStateType; import eu.eudat.types.grant.GrantStateType;
import jakarta.persistence.criteria.Join;
import jakarta.persistence.criteria.JoinType;
import jakarta.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.JoinType;
import javax.transaction.Transactional;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -46,9 +46,9 @@ public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
query.where(((builder, root) -> root.get("grant").in(criteria.getGrants()))); query.where(((builder, root) -> root.get("grant").in(criteria.getGrants())));
if (!criteria.getAllVersions()) if (!criteria.getAllVersions())
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"), query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"),
query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and( query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and(
builder1.equal(externalRoot.get("groupId"), nestedRoot.get("groupId")), builder1.equal(externalRoot.get("groupId"), nestedRoot.get("groupId")),
builder1.notEqual(nestedRoot.get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), String.class))); builder1.notEqual(nestedRoot.get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), Integer.class)));
if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty()) if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty())
query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds())); query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds()));
if (criteria.getStatus() != null) { if (criteria.getStatus() != null) {

View File

@ -15,8 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.persistence.criteria.Join; import jakarta.persistence.criteria.Join;
import javax.persistence.criteria.JoinType; import jakarta.persistence.criteria.JoinType;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -52,7 +52,7 @@ public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDa
if (criteria.getPeriodStart() != null) if (criteria.getPeriodStart() != null)
query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart())); query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart()));
if (!criteria.getAllVersions()) if (!criteria.getAllVersions())
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"), query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and(builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")), builder1.notEqual(nestedRoot.get("dmp").get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), String.class))); query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("dmp").get("version"), query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.and(builder1.equal(externalRoot.get("dmp").get("groupId"), nestedRoot.get("dmp").get("groupId")), builder1.notEqual(nestedRoot.get("dmp").get("status"), DMP.DMPStatus.DELETED.getValue())), Arrays.asList(new SelectionField(FieldSelectionType.COMPOSITE_FIELD, "dmp:version")), Integer.class)));
if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty()) if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty())
query.where((builder, root) -> root.get("dmp").get("groupId").in(criteria.getGroupIds())); query.where((builder, root) -> root.get("dmp").get("groupId").in(criteria.getGroupIds()));
if (criteria.getDmpIds() != null && !criteria.getDmpIds().isEmpty()) if (criteria.getDmpIds() != null && !criteria.getDmpIds().isEmpty())

View File

@ -12,8 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.persistence.criteria.Join; import jakarta.persistence.criteria.Join;
import javax.persistence.criteria.JoinType; import jakarta.persistence.criteria.JoinType;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -35,8 +35,8 @@ public class DatasetProfileDaoImpl extends DatabaseAccess<DescriptionTemplate> i
query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%")); query.where((builder, root) -> builder.like(builder.upper(root.get("label")), "%" + criteria.getLike().toUpperCase() + "%"));
if (!criteria.getAllVersions()) if (!criteria.getAllVersions())
query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"), query.initSubQuery(String.class).where((builder, root) -> builder.equal(root.get("version"),
query.<String>subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("groupId"), query.subQueryMax((builder1, externalRoot, nestedRoot) -> builder1.equal(externalRoot.get("groupId"),
nestedRoot.get("groupId")), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), String.class))); nestedRoot.get("groupId")), Arrays.asList(new SelectionField(FieldSelectionType.FIELD, "version")), Integer.class)));
if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty()) if (criteria.getGroupIds() != null && !criteria.getGroupIds().isEmpty())
query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds())); query.where((builder, root) -> root.get("groupId").in(criteria.getGroupIds()));
if (criteria.getFilter() != null && criteria.getUserId() != null) { if (criteria.getFilter() != null && criteria.getUserId() != null) {

View File

@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.transaction.Transactional; import jakarta.transaction.Transactional;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@ -13,7 +13,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import schemasMicrosoftComOfficeOffice.LeftDocument; import schemasMicrosoftComOfficeOffice.LeftDocument;
import javax.persistence.criteria.JoinType; import jakarta.persistence.criteria.JoinType;
import java.util.Date; import java.util.Date;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@ -11,7 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.persistence.criteria.JoinType; import jakarta.persistence.criteria.JoinType;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@ -8,7 +8,7 @@ import eu.eudat.data.entities.UserInfo;
import eu.eudat.queryable.QueryableList; import eu.eudat.queryable.QueryableList;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.persistence.criteria.JoinType; import jakarta.persistence.criteria.JoinType;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -5,7 +5,7 @@ import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;

View File

@ -3,7 +3,7 @@ package eu.eudat.data.entities;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -3,7 +3,7 @@ package eu.eudat.data.entities;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.UUID; import java.util.UUID;

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -59,7 +59,7 @@ public class DMPProfile implements DataEntity<DMPProfile, UUID> {
@Column(name = "\"Label\"") @Column(name = "\"Label\"")
private String label; private String label;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition; private String definition;

View File

@ -4,7 +4,7 @@ package eu.eudat.data.entities;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.UUID; import java.util.UUID;
@ -18,11 +18,9 @@ public class DMPResearcher {
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") @Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id; private UUID id;
@Type(type = "org.hibernate.type.PostgresUUIDType")
@Column(name = "\"DMP\"") @Column(name = "\"DMP\"")
private UUID dmp; private UUID dmp;
@Type(type = "org.hibernate.type.PostgresUUIDType")
@Column(name = "\"Researcher\"") @Column(name = "\"Researcher\"")
private UUID researcher; private UUID researcher;

View File

@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -32,7 +32,7 @@ public class DataRepository implements Serializable, DataEntity<DataRepository,
@Column(name = "\"Uri\"") @Column(name = "\"Uri\"")
private String uri; private String uri;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml") @Column(name = "\"Definition\"", columnDefinition = "xml")
private String definition; private String definition;

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -106,7 +106,7 @@ public class Dataset implements DataEntity<Dataset, UUID> {
@Column(name = "\"Uri\"") @Column(name = "\"Uri\"")
private String uri; private String uri;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Properties\"", columnDefinition = "xml") @Column(name = "\"Properties\"", columnDefinition = "xml")
private String properties; private String properties;
@ -115,7 +115,7 @@ public class Dataset implements DataEntity<Dataset, UUID> {
@JoinColumn(name = "\"Profile\"") @JoinColumn(name = "\"Profile\"")
private DescriptionTemplate profile; private DescriptionTemplate profile;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Reference\"", columnDefinition = "xml") @Column(name = "\"Reference\"", columnDefinition = "xml")
private String reference; private String reference;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -4,7 +4,7 @@ package eu.eudat.data.entities;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.UUID; import java.util.UUID;
@ -23,7 +23,7 @@ public class DatasetProfileRuleset {
@Column(name = "\"Label\"") @Column(name = "\"Label\"")
private String label; private String label;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
private String definition; private String definition;

View File

@ -4,7 +4,7 @@ package eu.eudat.data.entities;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.UUID; import java.util.UUID;
@ -23,7 +23,7 @@ public class DatasetProfileViewstyle {
@Column(name = "\"Label\"") @Column(name = "\"Label\"")
private String label; private String label;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
private String definition; private String definition;

View File

@ -4,7 +4,7 @@ package eu.eudat.data.entities;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.UUID; import java.util.UUID;
@ -19,12 +19,11 @@ public class DatasetRegistry {
@Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)") @Column(name = "\"ID\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id; private UUID id;
//DEPWARN dependency to Hibernate and PostgreSQL
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
@Column(name = "\"Dataset\"", nullable = false) @Column(name = "\"Dataset\"", nullable = false)
private UUID dataset; private UUID dataset;
@Type(type = "org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL //DEPWARN dependency to Hibernate and PostgreSQL
@Column(name = "\"Registry\"", nullable = false) @Column(name = "\"Registry\"", nullable = false)
private UUID registry; private UUID registry;

View File

@ -4,7 +4,7 @@ package eu.eudat.data.entities;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -55,7 +55,7 @@ public class DescriptionTemplate implements DataEntity<DescriptionTemplate,UUID>
@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile") @OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
private Set<Dataset> dataset; private Set<Dataset> dataset;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
private String definition; private String definition;

View File

@ -3,7 +3,7 @@ package eu.eudat.data.entities;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -24,7 +24,6 @@ public class EntityDoi implements DataEntity<EntityDoi, UUID> {
private UUID id; private UUID id;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@Type(type = "eu.eudat.configurations.typedefinition.PostgreSQLEnumType")
@Column(name = "\"EntityType\"", nullable = false) @Column(name = "\"EntityType\"", nullable = false)
private EntityType entityType; private EntityType entityType;

View File

@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;

View File

@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -32,7 +32,6 @@ public class FileUpload implements DataEntity<FileUpload, UUID> {
private UUID entityId; private UUID entityId;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@Type(type = "eu.eudat.configurations.typedefinition.PostgreSQLEnumType")
@Column(name = "\"EntityType\"", nullable = false) @Column(name = "\"EntityType\"", nullable = false)
private EntityType entityType; private EntityType entityType;

View File

@ -4,7 +4,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -74,11 +74,11 @@ public class Funder implements DataEntity<Funder, UUID> {
@Column(name = "\"Label\"") @Column(name = "\"Label\"")
private String label; private String label;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
private String reference; private String reference;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition; private String definition;

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -102,7 +102,7 @@ public class Grant implements DataEntity<Grant, UUID> {
@Column(name = "\"Uri\"") @Column(name = "\"Uri\"")
private String uri; private String uri;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition; private String definition;

View File

@ -5,7 +5,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
@ -37,7 +37,7 @@ public class Invitation implements DataEntity<Invitation, UUID> {
@Column(name = "\"AcceptedInvitation\"", nullable = false) @Column(name = "\"AcceptedInvitation\"", nullable = false)
private boolean acceptedInvitation; private boolean acceptedInvitation;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Properties\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Properties\"", columnDefinition = "xml", nullable = true)
private String properties; private String properties;

View File

@ -5,7 +5,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -7,7 +7,7 @@ import eu.eudat.data.enumeration.notification.NotifyState;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -35,14 +35,14 @@ public class Organisation implements Serializable, DataEntity<Organisation,UUID>
@Column(name = "\"Abbreviation\"") @Column(name = "\"Abbreviation\"")
private String abbreviation; private String abbreviation;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
private String reference; private String reference;
@Column(name = "\"Uri\"") @Column(name = "\"Uri\"")
private String uri; private String uri;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition; private String definition;

View File

@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -87,7 +87,7 @@ public class Project implements DataEntity<Project, UUID> {
@Column(name = "\"Uri\"") @Column(name = "\"Uri\"")
private String uri; private String uri;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition; private String definition;

View File

@ -6,7 +6,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -33,7 +33,7 @@ public class Registry implements DataEntity<Registry, UUID> {
@Column(name = "\"Uri\"") @Column(name = "\"Uri\"")
private String uri; private String uri;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition; private String definition;

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -33,11 +33,11 @@ public class Researcher implements DataEntity<Researcher, UUID> {
@Column(name = "\"PrimaryEmail\"") @Column(name = "\"PrimaryEmail\"")
private String primaryEmail; private String primaryEmail;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = true)
private String definition; private String definition;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true) @Column(name = "\"Reference\"", columnDefinition = "xml", nullable = true)
private String reference; private String reference;

View File

@ -5,7 +5,7 @@ import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -32,7 +32,7 @@ public class Service implements DataEntity<Service, UUID> {
@Column(name = "\"Uri\"") @Column(name = "\"Uri\"")
private String uri; private String uri;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false) @Column(name = "\"Definition\"", columnDefinition = "xml", nullable = false)
private String definition; private String definition;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -6,7 +6,7 @@ import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.*; import java.util.*;
@ -55,7 +55,7 @@ public class UserInfo implements DataEntity<UserInfo, UUID> {
private Date lastloggedin = null; private Date lastloggedin = null;
@Type(type = "eu.eudat.configurations.typedefinition.XMLType") @Type(eu.eudat.configurations.typedefinition.XMLType.class)
@Column(name = "additionalinfo", nullable = true) @Column(name = "additionalinfo", nullable = true)
private String additionalinfo; private String additionalinfo;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -4,7 +4,7 @@ import eu.eudat.data.converters.DateToUTCConverter;
import eu.eudat.data.entities.helpers.EntityBinder; import eu.eudat.data.entities.helpers.EntityBinder;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import javax.persistence.*; import jakarta.persistence.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -1,6 +1,6 @@
package eu.eudat.data.entities.helpers; package eu.eudat.data.entities.helpers;
import javax.persistence.Tuple; import jakarta.persistence.Tuple;
import java.util.List; import java.util.List;
public class EntityBinder { public class EntityBinder {

View File

@ -9,7 +9,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField; import eu.eudat.queryable.types.SelectionField;
import javax.persistence.criteria.Subquery; import jakarta.persistence.criteria.Subquery;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField; import eu.eudat.queryable.types.SelectionField;
import javax.persistence.criteria.Subquery; import jakarta.persistence.criteria.Subquery;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField; import eu.eudat.queryable.types.SelectionField;
import javax.persistence.criteria.Subquery; import jakarta.persistence.criteria.Subquery;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

View File

@ -7,7 +7,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField; import eu.eudat.queryable.types.SelectionField;
import javax.persistence.criteria.Subquery; import jakarta.persistence.criteria.Subquery;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;

View File

@ -10,7 +10,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version> <version>3.1.2</version>
</parent> </parent>
<modules> <modules>
@ -18,36 +18,24 @@
<module>web</module> <module>web</module>
<module>data</module> <module>data</module>
<module>elastic</module> <module>elastic</module>
<module>core</module>
</modules> </modules>
<properties> <properties>
<project.http.version>1.19.0</project.http.version> <project.http.version>1.19.0</project.http.version>
<project.oauth.version>1.19.0</project.oauth.version> <project.oauth.version>1.19.0</project.oauth.version>
<project.version>0.2.0</project.version> <project.version>0.2.0</project.version>
<java.version>1.8</java.version> <java.version>17</java.version>
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version> <dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
<org.springframework.version>5.3.8</org.springframework.version>
<!-- <org.springframeweu.eudat.logic.securityrity.version>3.2.10.RELEASE</org.springframeweu.eudat.logic.securityrity.version> -->
<org.springframework.security.version>5.3.10.RELEASE</org.springframework.security.version>
<!--<com.sun.jersey.version>1.19.1</com.sun.jersey.version>-->
<!--
<org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version>
-->
<!--<com.fasterxml.jackson>2.9.0</com.fasterxml.jackson>-->
<hibernate.version>5.5.3.Final</hibernate.version>
<commons-codec.version>1.9</commons-codec.version> <commons-codec.version>1.9</commons-codec.version>
<org.junit.version>4.11</org.junit.version> <org.junit.version>4.11</org.junit.version>
<log4j.version>1.2.17</log4j.version> <log4j.version>1.2.17</log4j.version>
<log4j2.version>2.15.0</log4j2.version> <log4j2.version>2.15.0</log4j2.version>
<slf4j.version>1.7.15</slf4j.version>
<!--<jetty.version>11.0.5 <maven.compiler.source>17</maven.compiler.source>
</jetty.version>--> <!-- Adapt this to a version found on http://repo.maven.apache.org/maven2/org/eclipse/jetty/jetty-maven-plugin/ --> <maven.compiler.target>17</maven.compiler.target>
<logback.version>1.2.3</logback.version>
<!-- <javax.inject.version>1</javax.inject.version>-->
<!--<javax.servlet.servlet-api.version>3.0.1</javax.servlet.servlet-api.version>-->
</properties> </properties>
<dependencies> <dependencies>
@ -55,12 +43,11 @@
<dependency> <dependency>
<groupId>org.json</groupId> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>20160810</version> <version>20230227</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId> <artifactId>spring-context-support</artifactId>
<version>${org.springframework.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -89,15 +76,13 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient5</artifactId>
<version>4.5.12</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-nio</artifactId> <artifactId>httpcore-nio</artifactId>
<version>4.4.13</version>
</dependency> </dependency>
<dependency> <dependency>
@ -112,22 +97,20 @@
<version>7.6.0</version> <version>7.6.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId> <artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-c3p0</artifactId> <artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client --> <!-- https://mvnrepository.com/artifact/com.google.api-client/google-api-client -->
<dependency> <dependency>
<groupId>com.google.api-client</groupId> <groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId> <artifactId>google-api-client</artifactId>
<version>1.23.0</version> <version>1.35.2</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path --> <!-- https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path -->
<dependency> <dependency>
@ -141,7 +124,6 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId> <artifactId>jackson-dataformat-xml</artifactId>
<version>2.12.3</version>
</dependency> </dependency>
@ -149,13 +131,16 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId> <artifactId>jackson-core</artifactId>
<version>2.12.3</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind --> <!-- https://mvnrepository.com/artifact/com.fasterxml.jackeu.eudat.corecore/jackson-databind -->
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId> <artifactId>jackson-databind</artifactId>
<version>2.12.3</version> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
</dependency> </dependency>
<!-- g/a spring --> <!-- g/a spring -->
@ -173,13 +158,13 @@
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId> <artifactId>poi-ooxml</artifactId>
<version>4.1.1</version> <version>4.1.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId> <artifactId>poi</artifactId>
<version>4.1.1</version> <version>4.1.2</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop --> <!-- https://mvnrepository.com/artifact/org.apache.xmlgraphics/fop -->
@ -192,7 +177,7 @@
<dependency> <dependency>
<groupId>org.jsoup</groupId> <groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId> <artifactId>jsoup</artifactId>
<version>1.14.3</version> <version>1.15.3</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf --> <!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf -->
<dependency> <dependency>
@ -210,7 +195,7 @@
<dependency> <dependency>
<groupId>fr.opensagres.xdocreport</groupId> <groupId>fr.opensagres.xdocreport</groupId>
<artifactId>fr.opensagres.xdocreport.itext.extension</artifactId> <artifactId>fr.opensagres.xdocreport.itext.extension</artifactId>
<version>2.0.1</version> <version>2.0.4</version>
</dependency> </dependency>
<dependency> <dependency>
@ -236,7 +221,7 @@
<version>2.8.2</version> <version>2.8.2</version>
</dependency>--> </dependency>-->
<!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api --> <!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jaxb-api -->
<dependency> <dependency>
<groupId>javax.xml.bind</groupId> <groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId> <artifactId>jaxb-api</artifactId>
@ -247,62 +232,66 @@
<dependency> <dependency>
<groupId>org.glassfish.jaxb</groupId> <groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId> <artifactId>jaxb-core</artifactId>
<version>2.3.0</version> <version>4.0.3</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime --> <!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency> <dependency>
<groupId>org.glassfish.jaxb</groupId> <groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId> <artifactId>jaxb-runtime</artifactId>
<version>2.3.1</version> <version>4.0.3</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api --> <!-- https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api -->
<dependency> <dependency>
<groupId>javax.annotation</groupId> <groupId>jakarta.annotation</groupId>
<artifactId>javax.annotation-api</artifactId> <artifactId>jakarta.annotation-api</artifactId>
<version>1.3.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/javax.validation/validation-api --> <!-- https://mvnrepository.com/artifact/jakarta.validation/validation-api -->
<dependency> <dependency>
<groupId>javax.validation</groupId> <groupId>jakarta.validation</groupId>
<artifactId>validation-api</artifactId> <artifactId>jakarta.validation-api</artifactId>
<version>2.0.1.Final</version> </dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.1.0</version>
</dependency> </dependency>
<!-- The client --> <!-- &lt;!&ndash; The client &ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>io.prometheus</groupId> <!-- <groupId>io.prometheus</groupId>-->
<artifactId>simpleclient</artifactId> <!-- <artifactId>simpleclient</artifactId>-->
<version>0.11.0</version> <!-- <version>0.11.0</version>-->
</dependency> <!-- </dependency>-->
<!-- Hotspot JVM metrics--> <!-- &lt;!&ndash; Hotspot JVM metrics&ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>io.prometheus</groupId> <!-- <groupId>io.prometheus</groupId>-->
<artifactId>simpleclient_hotspot</artifactId> <!-- <artifactId>simpleclient_hotspot</artifactId>-->
<version>0.11.0</version> <!-- <version>0.11.0</version>-->
</dependency> <!-- </dependency>-->
<!-- Exposition HTTPServer--> <!-- &lt;!&ndash; Exposition HTTPServer&ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>io.prometheus</groupId> <!-- <groupId>io.prometheus</groupId>-->
<artifactId>simpleclient_httpserver</artifactId> <!-- <artifactId>simpleclient_httpserver</artifactId>-->
<version>0.11.0</version> <!-- <version>0.11.0</version>-->
</dependency> <!-- </dependency>-->
<!-- Pushgateway exposition--> <!-- &lt;!&ndash; Pushgateway exposition&ndash;&gt;-->
<dependency> <!-- <dependency>-->
<groupId>io.prometheus</groupId> <!-- <groupId>io.prometheus</groupId>-->
<artifactId>simpleclient_pushgateway</artifactId> <!-- <artifactId>simpleclient_pushgateway</artifactId>-->
<version>0.11.0</version> <!-- <version>0.11.0</version>-->
</dependency> <!-- </dependency>-->
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus --> <!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus -->
<dependency> <dependency>
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId> <artifactId>micrometer-registry-prometheus</artifactId>
<version>1.7.1</version> <version>1.11.2</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -314,8 +303,19 @@
<artifactId>micrometer-core</artifactId> <artifactId>micrometer-core</artifactId>
</dependency> </dependency>
</dependencies> <!--CITE DEPENDENCIES-->
<dependency>
<groupId>gr.cite</groupId>
<artifactId>data-tools</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>gr.cite</groupId>
<artifactId>exceptions</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<profiles> <profiles>
<profile> <profile>
@ -327,18 +327,17 @@
<packaging.type>jar</packaging.type> <packaging.type>jar</packaging.type>
</properties> </properties>
</profile> </profile>
<profile> <!-- <profile>-->
<id>intellij-properties-launcher</id> <!-- <id>intellij-properties-launcher</id>-->
<dependencies> <!-- <dependencies>-->
<dependency> <!-- <dependency>-->
<groupId>org.springframework.boot</groupId> <!-- <groupId>org.springframework.boot</groupId>-->
<artifactId>spring-boot-loader</artifactId> <!-- <artifactId>spring-boot-loader</artifactId>-->
<version>2.5.2</version> <!-- </dependency>-->
</dependency> <!-- </dependencies>-->
</dependencies>
</profile> <!-- </profile>-->
<profile> <profile>
<id>production</id> <id>production</id>
<properties> <properties>

View File

@ -4,9 +4,9 @@ import eu.eudat.queryable.jpa.predicates.*;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import eu.eudat.queryable.types.SelectionField; import eu.eudat.queryable.types.SelectionField;
import javax.persistence.criteria.Join; import jakarta.persistence.criteria.Join;
import javax.persistence.criteria.JoinType; import jakarta.persistence.criteria.JoinType;
import javax.persistence.criteria.Subquery; import jakarta.persistence.criteria.Subquery;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View File

@ -2,7 +2,7 @@ package eu.eudat.queryable.collector;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import javax.persistence.Tuple; import jakarta.persistence.Tuple;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;

View File

@ -2,7 +2,7 @@ package eu.eudat.queryable.collector;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import javax.persistence.Tuple; import jakarta.persistence.Tuple;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;

View File

@ -8,38 +8,56 @@ import eu.eudat.queryable.jpa.predicates.*;
import eu.eudat.queryable.queryableentity.DataEntity; import eu.eudat.queryable.queryableentity.DataEntity;
import eu.eudat.queryable.types.FieldSelectionType; import eu.eudat.queryable.types.FieldSelectionType;
import eu.eudat.queryable.types.SelectionField; import eu.eudat.queryable.types.SelectionField;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Tuple;
import jakarta.persistence.TypedQuery;
import jakarta.persistence.criteria.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import javax.persistence.EntityManager;
import javax.persistence.Tuple;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.*;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class QueryableHibernateList<T extends DataEntity> implements QueryableList<T> { public class QueryableHibernateList<T extends DataEntity> implements QueryableList<T> {
private static final Logger logger = LoggerFactory.getLogger(QueryableHibernateList.class); private static final Logger logger = LoggerFactory.getLogger(QueryableHibernateList.class);
private Collector collector = new Collector(); private Collector collector = new Collector();
private EntityManager manager; private EntityManager manager;
private CriteriaQuery query; private CriteriaQuery query;
private Class<T> tClass; private Class<T> tClass;
private Root<T> root; private Root<T> root;
private Root<T> nestedQueryRoot; private Root<T> nestedQueryRoot;
private Subquery subquery; private Subquery subquery;
private List<SinglePredicate<T>> singlePredicates = new LinkedList<>(); private List<SinglePredicate<T>> singlePredicates = new LinkedList<>();
private List<NestedQuerySinglePredicate<T>> nestedPredicates = new LinkedList<>(); private List<NestedQuerySinglePredicate<T>> nestedPredicates = new LinkedList<>();
private boolean distinct = false; private boolean distinct = false;
private List<OrderByPredicate<T>> orderings = new LinkedList<>(); private List<OrderByPredicate<T>> orderings = new LinkedList<>();
private List<GroupByPredicate<T>> groupings = new LinkedList<>(); private List<GroupByPredicate<T>> groupings = new LinkedList<>();
private List<String> fields = new LinkedList<>(); private List<String> fields = new LinkedList<>();
private Integer length; private Integer length;
private Integer offset; private Integer offset;
private Set<String> hints; private Set<String> hints;
private String hint; private String hint;
private Map<String, Join> joinsMap = new HashMap<>(); private Map<String, Join> joinsMap = new HashMap<>();
public QueryableHibernateList(EntityManager manager, Class<T> tClass) { public QueryableHibernateList(EntityManager manager, Class<T> tClass) {
@ -89,14 +107,16 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
} }
private Join getJoin(String field, String path, Join joined, JoinType type) { private Join getJoin(String field, String path, Join joined, JoinType type) {
if (this.joinsMap.containsKey(path)) return this.joinsMap.get(path); if (this.joinsMap.containsKey(path))
return this.joinsMap.get(path);
Join join = joined.join(path, type); Join join = joined.join(path, type);
this.joinsMap.put(path, join); this.joinsMap.put(path, join);
return join; return join;
} }
public Join getJoin(String field, JoinType type) { public Join getJoin(String field, JoinType type) {
if (this.joinsMap.containsKey(field)) return this.joinsMap.get(field); if (this.joinsMap.containsKey(field))
return this.joinsMap.get(field);
Join join = this.root.join(field, type); Join join = this.root.join(field, type);
this.joinsMap.put(field, join); this.joinsMap.put(field, join);
return join; return join;
@ -161,10 +181,13 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder();
CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class); CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
this.root = criteriaQuery.from(tClass); this.root = criteriaQuery.from(tClass);
if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id"))); if (distinct)
else criteriaQuery.select(criteriaBuilder.count(this.root)); criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id")));
else
criteriaQuery.select(criteriaBuilder.count(this.root));
criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); if (!this.groupings.isEmpty())
criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root));
//if (distinct) criteriaQuery.distinct(true); //if (distinct) criteriaQuery.distinct(true);
//GK: Group By special case. When group by is used, since it will result in a list of how many elements have the grouped field common //GK: Group By special case. When group by is used, since it will result in a list of how many elements have the grouped field common
@ -181,10 +204,13 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder(); CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder();
CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class); CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
this.root = criteriaQuery.from(tClass); this.root = criteriaQuery.from(tClass);
if (distinct) criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id"))); if (distinct)
else criteriaQuery.select(criteriaBuilder.count(this.root)); criteriaQuery.select(criteriaBuilder.countDistinct(this.root.get("id")));
else
criteriaQuery.select(criteriaBuilder.count(this.root));
criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); criteriaQuery.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); if (!this.groupings.isEmpty())
criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root));
//if (distinct) criteriaQuery.distinct(true); //if (distinct) criteriaQuery.distinct(true);
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
if (this.groupings.isEmpty()) { if (this.groupings.isEmpty()) {
@ -195,7 +221,6 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
}); });
} }
private Predicate[] generateWherePredicates(List<SinglePredicate<T>> singlePredicates, Root<T> root, List<NestedQuerySinglePredicate<T>> nestedPredicates, Root<T> nestedQueryRoot) { private Predicate[] generateWherePredicates(List<SinglePredicate<T>> singlePredicates, Root<T> root, List<NestedQuerySinglePredicate<T>> nestedPredicates, Root<T> nestedQueryRoot) {
List<Predicate> predicates = new LinkedList<>(); List<Predicate> predicates = new LinkedList<>();
predicates.addAll(Arrays.asList(this.generateSingleWherePredicates(singlePredicates, root))); predicates.addAll(Arrays.asList(this.generateSingleWherePredicates(singlePredicates, root)));
@ -237,24 +262,33 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
public List<T> toList() { public List<T> toList() {
CriteriaBuilder builder = this.manager.getCriteriaBuilder(); CriteriaBuilder builder = this.manager.getCriteriaBuilder();
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); if (!this.fields.isEmpty())
else this.query = builder.createQuery(this.tClass); this.query = builder.createTupleQuery();
else
this.query = builder.createQuery(this.tClass);
this.root = this.query.from(this.tClass); this.root = this.query.from(this.tClass);
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root)); if (!this.orderings.isEmpty())
if (!this.groupings.isEmpty()) this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root)); this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root));
if (!this.fields.isEmpty()) this.selectFields(); if (!this.groupings.isEmpty())
if (distinct) this.query.distinct(true); this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root));
if (!this.fields.isEmpty())
this.selectFields();
if (distinct)
this.query.distinct(true);
//if (!this.fields.isEmpty()) this.query.multiselect(this.parseFields(this.fields)); //if (!this.fields.isEmpty()) this.query.multiselect(this.parseFields(this.fields));
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
if (!this.fields.isEmpty()) return this.toListWithFields().stream().map(m -> mapper.convertValue(m, this.tClass)).collect(Collectors.toList()); if (!this.fields.isEmpty())
return this.toListWithFields().stream().map(m -> mapper.convertValue(m, this.tClass)).collect(Collectors.toList());
return this.toListWithOutFields(); return this.toListWithOutFields();
} }
public List<Map> toListWithFields() { public List<Map> toListWithFields() {
TypedQuery<Tuple> typedQuery = this.manager.createQuery(this.query); TypedQuery<Tuple> typedQuery = this.manager.createQuery(this.query);
if (this.offset != null) typedQuery.setFirstResult(this.offset); if (this.offset != null)
if (this.length != null) typedQuery.setMaxResults(this.length); typedQuery.setFirstResult(this.offset);
if (this.length != null)
typedQuery.setMaxResults(this.length);
List<Tuple> results = typedQuery.getResultList(); List<Tuple> results = typedQuery.getResultList();
Map<Object, List<Tuple>> groupedResults = results.stream() Map<Object, List<Tuple>> groupedResults = results.stream()
.collect(Collectors.groupingBy(x -> x.get("id"))); .collect(Collectors.groupingBy(x -> x.get("id")));
@ -263,11 +297,14 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
private List<T> toListWithOutFields() { private List<T> toListWithOutFields() {
TypedQuery<T> typedQuery = this.manager.createQuery(this.query); TypedQuery<T> typedQuery = this.manager.createQuery(this.query);
if (this.offset != null) typedQuery.setFirstResult(this.offset); if (this.offset != null)
if (this.length != null) typedQuery.setMaxResults(this.length); typedQuery.setFirstResult(this.offset);
if (this.length != null)
typedQuery.setMaxResults(this.length);
if (this.hint != null) { if (this.hint != null) {
List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList()); List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList());
if (ids != null && !ids.isEmpty()) typedQuery = queryWithHint(ids); if (ids != null && !ids.isEmpty())
typedQuery = queryWithHint(ids);
} }
return typedQuery.getResultList(); return typedQuery.getResultList();
} }
@ -275,16 +312,24 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
@Async @Async
public CompletableFuture<List<T>> toListAsync() { public CompletableFuture<List<T>> toListAsync() {
CriteriaBuilder builder = this.manager.getCriteriaBuilder(); CriteriaBuilder builder = this.manager.getCriteriaBuilder();
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); if (!this.fields.isEmpty())
else this.query = builder.createQuery(this.tClass); this.query = builder.createTupleQuery();
else
this.query = builder.createQuery(this.tClass);
this.root = this.query.from(this.tClass); this.root = this.query.from(this.tClass);
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.orderings.isEmpty()) this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root)); if (!this.orderings.isEmpty())
if (!this.groupings.isEmpty()) this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root)); this.query.orderBy(this.generateOrderPredicates(this.orderings, this.root));
if (!this.fields.isEmpty()) this.selectFields(); if (!this.groupings.isEmpty())
if (distinct) this.query.distinct(true); this.query.groupBy(this.generateGroupPredicates(this.groupings, this.root));
if (!this.fields.isEmpty()) return this.toListAsyncWithFields(); if (!this.fields.isEmpty())
else return this.toListAsyncWithOutFields(); this.selectFields();
if (distinct)
this.query.distinct(true);
if (!this.fields.isEmpty())
return this.toListAsyncWithFields();
else
return this.toListAsyncWithOutFields();
} }
@Async @Async
@ -305,12 +350,15 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
@Async @Async
private CompletableFuture<List<T>> toListAsyncWithOutFields() { private CompletableFuture<List<T>> toListAsyncWithOutFields() {
TypedQuery<T> typedQuery = this.manager.createQuery(this.query); TypedQuery<T> typedQuery = this.manager.createQuery(this.query);
if (this.offset != null) typedQuery.setFirstResult(this.offset); if (this.offset != null)
if (this.length != null) typedQuery.setMaxResults(this.length); typedQuery.setFirstResult(this.offset);
if (this.length != null)
typedQuery.setMaxResults(this.length);
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
if (this.hint != null) { if (this.hint != null) {
List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList()); List ids = typedQuery.getResultList().stream().map(item -> item.getKeys()).collect(Collectors.toList());
if (ids != null && !ids.isEmpty()) return queryWithHint(ids).getResultList(); if (ids != null && !ids.isEmpty())
return queryWithHint(ids).getResultList();
} }
return typedQuery.getResultList(); return typedQuery.getResultList();
}); });
@ -318,62 +366,80 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
public T getSingle() { public T getSingle() {
CriteriaBuilder builder = this.manager.getCriteriaBuilder(); CriteriaBuilder builder = this.manager.getCriteriaBuilder();
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); if (!this.fields.isEmpty())
else this.query = builder.createQuery(this.tClass); this.query = builder.createTupleQuery();
else
this.query = builder.createQuery(this.tClass);
this.root = this.query.from(this.tClass); this.root = this.query.from(this.tClass);
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.fields.isEmpty()) this.selectFields(); if (!this.fields.isEmpty())
this.selectFields();
TypedQuery<T> typedQuery = this.manager.createQuery(this.query); TypedQuery<T> typedQuery = this.manager.createQuery(this.query);
if (this.hint != null) if (this.hint != null)
typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint));
return typedQuery.getSingleResult(); return typedQuery.getSingleResult();
} }
@Async @Async
public CompletableFuture<T> getSingleAsync() { public CompletableFuture<T> getSingleAsync() {
CriteriaBuilder builder = this.manager.getCriteriaBuilder(); CriteriaBuilder builder = this.manager.getCriteriaBuilder();
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); if (!this.fields.isEmpty())
else this.query = builder.createQuery(this.tClass); this.query = builder.createTupleQuery();
else
this.query = builder.createQuery(this.tClass);
this.root = this.query.from(this.tClass); this.root = this.query.from(this.tClass);
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.fields.isEmpty()) this.selectFields(); if (!this.fields.isEmpty())
this.selectFields();
TypedQuery<T> typedQuery = this.manager.createQuery(this.query); TypedQuery<T> typedQuery = this.manager.createQuery(this.query);
if (this.hint != null) if (this.hint != null)
typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint));
return CompletableFuture.supplyAsync(() -> typedQuery.getSingleResult()); return CompletableFuture.supplyAsync(() -> typedQuery.getSingleResult());
} }
public T getSingleOrDefault() { public T getSingleOrDefault() {
CriteriaBuilder builder = this.manager.getCriteriaBuilder(); CriteriaBuilder builder = this.manager.getCriteriaBuilder();
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); if (!this.fields.isEmpty())
else this.query = builder.createQuery(this.tClass); this.query = builder.createTupleQuery();
else
this.query = builder.createQuery(this.tClass);
this.root = this.query.from(this.tClass); this.root = this.query.from(this.tClass);
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.fields.isEmpty()) this.selectFields(); if (!this.fields.isEmpty())
this.selectFields();
TypedQuery<T> typedQuery = this.manager.createQuery(this.query); TypedQuery<T> typedQuery = this.manager.createQuery(this.query);
if (this.hint != null) if (this.hint != null)
typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint));
List<T> results = typedQuery.getResultList(); List<T> results = typedQuery.getResultList();
if (results.size() == 0) return null; if (results.size() == 0)
if (results.size() == 1) return results.get(0); return null;
else throw new NotSingleResultException("Query returned more than one items"); if (results.size() == 1)
return results.get(0);
else
throw new NotSingleResultException("Query returned more than one items");
} }
@Async @Async
public CompletableFuture<T> getSingleOrDefaultAsync() { public CompletableFuture<T> getSingleOrDefaultAsync() {
CriteriaBuilder builder = this.manager.getCriteriaBuilder(); CriteriaBuilder builder = this.manager.getCriteriaBuilder();
if (!this.fields.isEmpty()) this.query = builder.createTupleQuery(); if (!this.fields.isEmpty())
else this.query = builder.createQuery(this.tClass); this.query = builder.createTupleQuery();
else
this.query = builder.createQuery(this.tClass);
this.root = this.query.from(this.tClass); this.root = this.query.from(this.tClass);
this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot)); this.query.where(this.generateWherePredicates(this.singlePredicates, this.root, this.nestedPredicates, this.nestedQueryRoot));
if (!this.fields.isEmpty()) this.selectFields(); if (!this.fields.isEmpty())
this.selectFields();
TypedQuery<T> typedQuery = this.manager.createQuery(this.query); TypedQuery<T> typedQuery = this.manager.createQuery(this.query);
if (this.hint != null) if (this.hint != null)
typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint));
return CompletableFuture.supplyAsync(() -> typedQuery.getResultList()).thenApply(list -> { return CompletableFuture.supplyAsync(() -> typedQuery.getResultList()).thenApply(list -> {
if (list.size() == 0) return null; if (list.size() == 0)
if (list.size() == 1) return list.get(0); return null;
else throw new NotSingleResultException("Query returned more than one items"); if (list.size() == 1)
return list.get(0);
else
throw new NotSingleResultException("Query returned more than one items");
}); });
} }
@ -385,10 +451,11 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
if (!this.orderings.isEmpty()) if (!this.orderings.isEmpty())
criteriaQuery.orderBy(this.generateOrderPredicates(this.orderings, criteriaRoot)); criteriaQuery.orderBy(this.generateOrderPredicates(this.orderings, criteriaRoot));
if (!this.groupings.isEmpty()) criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root)); if (!this.groupings.isEmpty())
criteriaQuery.groupBy(this.generateGroupPredicates(this.groupings, this.root));
TypedQuery<T> typedQuery = this.manager.createQuery(criteriaQuery); TypedQuery<T> typedQuery = this.manager.createQuery(criteriaQuery);
typedQuery.setHint("javax.persistence.fetchgraph", this.manager.getEntityGraph(this.hint)); typedQuery.setHint("jakarta.persistence.fetchgraph", this.manager.getEntityGraph(this.hint));
return typedQuery; return typedQuery;
} }
@ -452,8 +519,8 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
@Override @Override
public <U extends public <U extends
Comparable> Subquery<U> subQueryMax(NestedQuerySinglePredicate<T> predicate, List<SelectionField> fields, Class<U> uClass) { Comparable> Subquery<U> subQueryMax(NestedQuerySinglePredicate<T> predicate, List<SelectionField> fields, Class<U> uClass) {
//Subquery<U> subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass); Subquery<U> subquery = this.manager.getCriteriaBuilder().createQuery().subquery(uClass);
//this.nestedQueryRoot = subquery.from(this.tClass); this.nestedQueryRoot = subquery.from(this.tClass);
subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot)); subquery.where(predicate.applyPredicate(this.manager.getCriteriaBuilder(), this.root, this.nestedQueryRoot));
if (fields.get(0).getType() == FieldSelectionType.FIELD) if (fields.get(0).getType() == FieldSelectionType.FIELD)
subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.<U>get(fields.get(0).getField()))); subquery.select(this.manager.getCriteriaBuilder().greatest(this.nestedQueryRoot.<U>get(fields.get(0).getField())));
@ -480,7 +547,8 @@ public class QueryableHibernateList<T extends DataEntity> implements QueryableLi
else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) { else if (fields.get(0).getType() == FieldSelectionType.COMPOSITE_FIELD) {
query.select(this.root.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1])); query.select(this.root.get(fields.get(0).getField().split(":")[0]).get(fields.get(0).getField().split(":")[1]));
} }
if (distinct) query.distinct(true); if (distinct)
query.distinct(true);
return query; return query;
} }

View File

@ -1,7 +1,7 @@
package eu.eudat.queryable.jpa.predicates; package eu.eudat.queryable.jpa.predicates;
import javax.persistence.criteria.Path; import jakarta.persistence.criteria.Path;
import javax.persistence.criteria.Root; import jakarta.persistence.criteria.Root;
import java.util.function.Predicate; import java.util.function.Predicate;
/** /**

View File

@ -1,8 +1,8 @@
package eu.eudat.queryable.jpa.predicates; package eu.eudat.queryable.jpa.predicates;
import javax.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Expression; import jakarta.persistence.criteria.Expression;
import javax.persistence.criteria.Root; import jakarta.persistence.criteria.Root;
public interface GroupByPredicate<T> { public interface GroupByPredicate<T> {
Expression<T> applyPredicate(CriteriaBuilder builder, Root<T> root); Expression<T> applyPredicate(CriteriaBuilder builder, Root<T> root);

View File

@ -1,8 +1,8 @@
package eu.eudat.queryable.jpa.predicates; package eu.eudat.queryable.jpa.predicates;
import javax.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Predicate; import jakarta.persistence.criteria.Predicate;
import javax.persistence.criteria.Root; import jakarta.persistence.criteria.Root;
/** /**
* Created by ikalyvas on 2/7/2018. * Created by ikalyvas on 2/7/2018.

View File

@ -1,8 +1,8 @@
package eu.eudat.queryable.jpa.predicates; package eu.eudat.queryable.jpa.predicates;
import javax.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Order; import jakarta.persistence.criteria.Order;
import javax.persistence.criteria.Root; import jakarta.persistence.criteria.Root;
public interface OrderByPredicate<T> { public interface OrderByPredicate<T> {
Order applyPredicate(CriteriaBuilder builder, Root<T> root); Order applyPredicate(CriteriaBuilder builder, Root<T> root);

View File

@ -1,8 +1,8 @@
package eu.eudat.queryable.jpa.predicates; package eu.eudat.queryable.jpa.predicates;
import javax.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Predicate; import jakarta.persistence.criteria.Predicate;
import javax.persistence.criteria.Root; import jakarta.persistence.criteria.Root;
public interface SinglePredicate<T> { public interface SinglePredicate<T> {
Predicate applyPredicate(CriteriaBuilder builder, Root<T> root); Predicate applyPredicate(CriteriaBuilder builder, Root<T> root);

View File

@ -1,6 +1,6 @@
package eu.eudat.queryable.queryableentity; package eu.eudat.queryable.queryableentity;
import javax.persistence.Tuple; import jakarta.persistence.Tuple;
import java.util.List; import java.util.List;
public interface DataEntity<T, K> { public interface DataEntity<T, K> {

View File

@ -16,6 +16,11 @@
</parent> </parent>
<dependencies> <dependencies>
<dependency>
<groupId>eu.eudat</groupId>
<artifactId>core</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>eu.eudat</groupId> <groupId>eu.eudat</groupId>
<artifactId>data</artifactId> <artifactId>data</artifactId>
@ -53,7 +58,6 @@
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
<version>2.12.3</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
@ -215,8 +219,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version> <version>3.8.1</version>
<configuration> <configuration>
<source>1.8</source> <source>17</source>
<target>1.8</target> <target>17</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -262,5 +266,7 @@
<properties> <properties>
<start-class>eu.eudat.EuDatApplication</start-class> <start-class>eu.eudat.EuDatApplication</start-class>
<opensaml.version>4.0.1</opensaml.version> <opensaml.version>4.0.1</opensaml.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties> </properties>
</project> </project>

View File

@ -1,17 +1,14 @@
package eu.eudat; package eu.eudat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication(scanBasePackages = {"eu.eudat", "eu.eudat.depositinterface"}) @SpringBootApplication(scanBasePackages = {"eu.eudat", "eu.eudat.depositinterface", "gr.cite"})
@EnableAsync @EnableAsync
public class EuDatApplication extends SpringBootServletInitializer { public class EuDatApplication extends SpringBootServletInitializer {
private static final Logger logger = LoggerFactory.getLogger(EuDatApplication.class);
@Override @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {

View File

@ -15,7 +15,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory; import jakarta.persistence.EntityManagerFactory;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.Properties; import java.util.Properties;
@ -66,8 +66,8 @@ public class DevelDatabaseConfiguration {
private Properties additionalProperties() { private Properties additionalProperties() {
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQL92Dialect"); properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
properties.setProperty("hibernate.show_sql", "true"); properties.setProperty("hibernate.show_sql", "false");
properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false"); properties.setProperty("hibernate.temp.use_jdbc_metadata_defaults", "false");
return properties; return properties;
} }

View File

@ -15,7 +15,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory; import jakarta.persistence.EntityManagerFactory;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.Properties; import java.util.Properties;

View File

@ -10,14 +10,14 @@ import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.List; import java.util.List;
@EnableAsync @EnableAsync
@Configuration @Configuration
@EnableScheduling @EnableScheduling
public class WebMVCConfiguration extends WebMvcConfigurerAdapter { public class WebMVCConfiguration implements WebMvcConfigurer {
private ApiContext apiContext; private ApiContext apiContext;

View File

@ -10,8 +10,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -10,8 +10,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -1,8 +1,8 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement; import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.List; import java.util.List;
@XmlRootElement @XmlRootElement

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class Dependency { public class Dependency {
private String id; private String id;

View File

@ -1,6 +1,6 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
public class Language { public class Language {
private String key; private String key;

View File

@ -2,8 +2,8 @@ package eu.eudat.configurations.dynamicfunder.entities;
import eu.eudat.logic.proxy.config.UrlConfiguration; import eu.eudat.logic.proxy.config.UrlConfiguration;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class MainProperty { public class MainProperty {

View File

@ -1,8 +1,8 @@
package eu.eudat.configurations.dynamicfunder.entities; package eu.eudat.configurations.dynamicfunder.entities;
import javax.xml.bind.annotation.XmlElement; import jakarta.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper; import jakarta.xml.bind.annotation.XmlElementWrapper;
import java.util.List; import java.util.List;
public class Property { public class Property {

View File

@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

View File

@ -11,8 +11,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller; import jakarta.xml.bind.Unmarshaller;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;

Some files were not shown because too many files have changed in this diff Show More