remove content

This commit is contained in:
Efstratios Giannopoulos 2024-01-04 13:19:00 +02:00
parent 26ab1fb612
commit a53396e38a
6 changed files with 0 additions and 323 deletions

View File

@ -1,153 +0,0 @@
package eu.eudat.data.old;
import eu.eudat.data.old.helpers.EntityBinder;
import eu.eudat.data.old.queryableentity.DataEntity;
import jakarta.persistence.*;
import java.util.List;
import java.util.UUID;
/**
* Created by ikalyvas on 3/15/2018.
*/
@Entity
@Table(name = "\"Content\"")
public class Content implements DataEntity<Content, UUID> { //IGNORE ME
public enum ParentType {
GRANT(0);
private int value;
private ParentType(int value) {
this.value = value;
}
public int getValue() {
return value;
}
public static ParentType fromInteger(int value) {
switch (value) {
case 0:
return GRANT;
default:
throw new RuntimeException("Unsupported Content Parent Type Status");
}
}
}
public enum LocationType {
EXTERNAL(0), INTERNAL(1);
private Integer value;
private LocationType(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
public static LocationType fromInteger(int value) {
switch (value) {
case 0:
return EXTERNAL;
case 1:
return INTERNAL;
default:
throw new RuntimeException("Unsupported Content Location Type");
}
}
}
@Id
@GeneratedValue
@Column(name = "\"Id\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id;
@Column(name = "\"Filename\"", nullable = false)
private String label;
@Column(name = "\"Extension\"", nullable = false)
private String extension;
@Column(name = "\"ParentType\"", nullable = false)
private Integer parentType;
@Column(name = "\"Uri\"", nullable = false)
private String uri;
@Column(name = "\"LocationType\"", nullable = false)
private Integer locationType;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getExtension() {
return extension;
}
public void setExtension(String extension) {
this.extension = extension;
}
public Integer getParentType() {
return parentType;
}
public void setParentType(Integer parentType) {
this.parentType = parentType;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public Integer getLocationType() {
return locationType;
}
public void setLocationType(Integer locationType) {
this.locationType = locationType;
}
@Override
public void update(Content entity) {
this.extension = entity.getExtension();
this.label = entity.getLabel();
this.locationType = entity.getLocationType();
this.parentType = entity.getParentType();
this.uri = entity.getUri();
}
@Override
public UUID getKeys() {
return this.id;
}
@Override
public Content buildFromTuple(List<Tuple> tuple, List<String> fields, String base) {
String currentBase = base.isEmpty() ? "" : base + ".";
if (fields.contains(currentBase + "id")) this.id = EntityBinder.fromTuple(tuple, currentBase + "id");
return this;
}
}

View File

@ -1,12 +0,0 @@
package eu.eudat.data.dao.entities;
import eu.eudat.data.dao.DatabaseAccessLayer;
import eu.eudat.data.old.Content;
import java.util.UUID;
/**
* Created by ikalyvas on 3/16/2018.
*/
public interface ContentDao extends DatabaseAccessLayer<Content, UUID> {
}

View File

@ -1,56 +0,0 @@
package eu.eudat.data.dao.entities;
import eu.eudat.data.dao.DatabaseAccess;
import eu.eudat.data.dao.databaselayer.service.DatabaseService;
import eu.eudat.data.old.Content;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.management.InvalidApplicationException;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
/**
* Created by ikalyvas on 3/16/2018.
*/
@Service("contentDao")
public class ContentDaoImpl extends DatabaseAccess<Content> implements ContentDao {
@Autowired
public ContentDaoImpl(DatabaseService<Content> databaseService) {
super(databaseService);
}
@Override
public Content createOrUpdate(Content item) {
return this.getDatabaseService().createOrUpdate(item, Content.class);
}
@Override
@Async
public CompletableFuture<Content> createOrUpdateAsync(Content item) {
return CompletableFuture.supplyAsync(() -> this.createOrUpdate(item));
}
@Override
public Content find(UUID id) throws InvalidApplicationException {
return this.getDatabaseService().getQueryable(Content.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
}
@Override
public Content find(UUID id, String hint) {
throw new UnsupportedOperationException();
}
@Override
public void delete(Content item) {
this.getDatabaseService().delete(item);
}
@Override
public QueryableList<Content> asQueryable() {
return this.getDatabaseService().getQueryable(Content.class);
}
}

View File

@ -1,90 +0,0 @@
package eu.eudat.logic.builders.entity;
import eu.eudat.logic.builders.Builder;
import eu.eudat.data.old.Content;
import java.util.UUID;
/**
* Created by ikalyvas on 3/16/2018.
*/
public class ContentBuilder extends Builder<Content> {
private UUID id;
private String label;
private String extension;
private Integer parentType;
private String uri;
private Integer locationType;
public UUID getId() {
return id;
}
public ContentBuilder id(UUID id) {
this.id = id;
return this;
}
public String getLabel() {
return label;
}
public ContentBuilder label(String label) {
this.label = label;
return this;
}
public String getExtension() {
return extension;
}
public ContentBuilder extension(String extension) {
this.extension = extension;
return this;
}
public Integer getParentType() {
return parentType;
}
public ContentBuilder parentType(Integer parentType) {
this.parentType = parentType;
return this;
}
public String getUri() {
return uri;
}
public ContentBuilder uri(String uri) {
this.uri = uri;
return this;
}
public Integer getLocationType() {
return locationType;
}
public ContentBuilder locationType(Integer locationType) {
this.locationType = locationType;
return this;
}
@Override
public Content build() {
Content content = new Content();
content.setExtension(extension);
content.setId(id);
content.setLabel(label);
content.setParentType(parentType);
content.setLocationType(locationType);
content.setUri(uri);
return content;
}
}

View File

@ -14,7 +14,6 @@ public interface DatabaseRepository {
InvitationDao getInvitationDao();
ContentDao getContentDao();
EmailConfirmationDao getLoginConfirmationEmailDao();

View File

@ -17,7 +17,6 @@ public class DatabaseRepositoryImpl implements DatabaseRepository {
private InvitationDao invitationDao;
private ContentDao contentDao;
private EmailConfirmationDao loginConfirmationEmailDao;
@ -75,16 +74,6 @@ public class DatabaseRepositoryImpl implements DatabaseRepository {
this.entityManager = entityManager;
}
@Override
public ContentDao getContentDao() {
return this.contentDao;
}
@Autowired
public void setContentDao(ContentDao contentDao) {
this.contentDao = contentDao;
}
@Override
public EmailConfirmationDao getLoginConfirmationEmailDao() {
return loginConfirmationEmailDao;