*/
package com.edf.gde.ejb;
+import com.edf.gde.entities.Attribute;
+import com.edf.gde.entities.AttributeGroup;
+import com.edf.gde.transferables.AttributeGroupTO;
+import com.edf.gde.transferables.AttributeTO;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
/**
*
@Stateless
@LocalBean
public class MetadataDAO {
+ @PersistenceContext(unitName = "GDE-ejbPU")
+ private EntityManager em;
- // Add business logic below. (Right-click in editor and choose
- // "Insert Code > Add Business Method")
+ /* Attributes */
+
+ public AttributeTO createAttribute(AttributeTO ato) {
+ Attribute a = Attribute.fromAttributeTO(ato);
+ em.persist(a);
+ return a.toAttributeTO();
+ }
+
+ public void deleteAttribute(AttributeTO ato) {
+ Attribute a = Attribute.fromAttributeTO(ato);
+ em.remove(a);
+ }
+
+ public AttributeTO updateAttribute(AttributeTO ato) {
+ Attribute a = Attribute.fromAttributeTO(ato);
+ Attribute up = em.merge(a);
+ return up.toAttributeTO();
+ }
+
+ public AttributeTO findAttribute(AttributeTO ato) {
+ Attribute found = em.find(Attribute.class, ato.getId());
+ return found.toAttributeTO();
+ }
+
+ private <T> AttributeTO findBy(String queryName, String varName, T value) {
+ try {
+ Attribute found = (Attribute) em.createNamedQuery(queryName)
+ .setParameter(varName, value)
+ .getSingleResult();
+ return found.toAttributeTO();
+ }
+ catch (Exception e) {
+ return null;
+ }
+ }
+
+ public AttributeTO findById(long id) {
+ return findBy("Attribute.findById", "id", id);
+ }
+
+ public AttributeTO findByName(String name) {
+ return findBy("Attribute.findByName", "name", name);
+ }
+
+ public AttributeTO findByType(String type) {
+ return findBy("Attribute.findByType", "type", type);
+ }
+
+ public AttributeTO findByValue(String value) {
+ return findBy("Attribute.findByValue", "value", value);
+ }
+
+ /* Attributes Groups */
+
+ public AttributeGroupTO createAttributeGroup(AttributeGroupTO agto) {
+ AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
+ em.persist(group);
+ return group.toAttributeGroupTO();
+ }
+
+ public void deleteAttributeGroup(AttributeGroupTO agto) {
+ AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
+ em.remove(group);
+ }
+
+ public AttributeGroupTO updateAttributeGroup(AttributeGroupTO agto) {
+ AttributeGroup group = AttributeGroup.fromAttributeGroupTO(agto);
+ AttributeGroup up = em.merge(group);
+ return up.toAttributeGroupTO();
+ }
+
+ public AttributeGroupTO findAttributeGroup(AttributeGroupTO agto) {
+ AttributeGroup found = em.find(AttributeGroup.class, agto.getId());
+ return found.toAttributeGroupTO();
+ }
+
+ public AttributeGroupTO findGroupById(long groupId) {
+ try {
+ AttributeGroup found = (AttributeGroup) em.createNamedQuery("AttributeGroup.findById")
+ .setParameter("id", groupId)
+ .getSingleResult();
+ return found.toAttributeGroupTO();
+ }
+ catch (Exception e) {
+ return null;
+ }
+ }
+
}
*/
package com.edf.gde.ejb;
+import com.edf.gde.entities.Study;
+import com.edf.gde.transferables.StudyTO;
+import java.util.Date;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;
import javax.persistence.EntityManager;
@PersistenceContext(unitName = "GDE-ejbPU")
private EntityManager em;
+ public StudyTO createStudy(StudyTO sto) {
+ Study s = Study.fromStudyTO(sto);
+ em.persist(s);
+ return s.toStudyTO();
+ }
+
+ public void deleteStudy(StudyTO sto) {
+ Study s = Study.fromStudyTO(sto);
+ em.remove(s);
+ }
+
+ public StudyTO updateStudy(StudyTO sto) {
+ Study s = Study.fromStudyTO(sto);
+ Study up = em.merge(s);
+ return up.toStudyTO();
+ }
+
+ public StudyTO findStudy(StudyTO sto) {
+ Study found = em.find(Study.class, sto.getId());
+ return found.toStudyTO();
+ }
+
+ private <T> StudyTO findBy(String queryName, String varName, T value) {
+ try {
+ Study found = (Study) em.createNamedQuery(queryName)
+ .setParameter(varName, value)
+ .getSingleResult();
+ return found.toStudyTO();
+ }
+ catch (Exception e) {
+ return null;
+ }
+ }
+
+ public StudyTO findById(long id) {
+ return findBy("Study.findById", "id", id);
+ }
+
+ public StudyTO findByName(String name) {
+ return findBy("Study.findByName", "name", name);
+ }
+
+ public StudyTO findByCreationDate(Date creationDate) {
+ return findBy("Study.findByCreationDate", "creationDate", creationDate);
+ }
+
+ public StudyTO findByUpdateDate(Date updateDate) {
+ return findBy("Study.findByUpdateDate", "updateDate", updateDate);
+ }
+
+ public StudyTO findByDeletionDate(Date deletionDate) {
+ return findBy("Study.findByDeletionDate", "deletionDate", deletionDate);
+ }
+
}
*/
package com.edf.gde.entities;
+import com.edf.gde.transferables.AttributeTO;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
private String value;
@Column(name = "mandatory")
private Boolean mandatory;
- @JoinColumn(name = "group_id", referencedColumnName = "id", nullable = false)
- @ManyToOne
- private AttributeGroup groupId;
+ @Column(name = "attribute_group_id")
+ private long attributeGroupId;
public Attribute() {
}
this.mandatory = mandatory;
}
- public AttributeGroup getGroupId() {
- return groupId;
+ public long getAttributeGroupId() {
+ return attributeGroupId;
}
- public void setGroupId(AttributeGroup groupId) {
- this.groupId = groupId;
+ public void setAttributeGroupId(long groupId) {
+ this.attributeGroupId = groupId;
}
+ public static Attribute fromAttributeTO(AttributeTO ato) {
+ Attribute attribute = new Attribute();
+ attribute.id = ato.getId();
+ attribute.name = ato.getName();
+ attribute.type = ato.getType();
+ attribute.value = ato.getValue();
+ attribute.mandatory = ato.getMandatory();
+ attribute.attributeGroupId = ato.getGroupId();
+ return attribute;
+ }
+
+ public AttributeTO toAttributeTO() {
+ AttributeTO ato = new AttributeTO();
+ ato.setId(this.id);
+ ato.setName(this.name);
+ ato.setType(this.type);
+ ato.setValue(this.value);
+ ato.setMandatory(this.mandatory);
+ ato.setGroupId(this.attributeGroupId);
+ return ato;
+ }
+
@Override
public String toString() {
return "com.edf.gde.entities.Attribute[ id=" + id + " ]";
@Override
public int hashCode() {
- int hash = 5;
+ int hash = 7;
hash = 29 * hash + (int) (this.id ^ (this.id >>> 32));
hash = 29 * hash + Objects.hashCode(this.name);
hash = 29 * hash + Objects.hashCode(this.type);
hash = 29 * hash + Objects.hashCode(this.value);
hash = 29 * hash + Objects.hashCode(this.mandatory);
- hash = 29 * hash + Objects.hashCode(this.groupId);
+ hash = 29 * hash + (int) (this.attributeGroupId ^ (this.attributeGroupId >>> 32));
return hash;
}
}
return true;
}
-
+
}
*/
package com.edf.gde.entities;
+import com.edf.gde.transferables.AttributeGroupTO;
+import com.edf.gde.transferables.AttributeTO;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
-import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
@SequenceGenerator(name = "SEQ_GEN_SEQUENCE", allocationSize = 50)
@Column(name = "id")
private long id;
- @OneToMany(mappedBy = "groupId")
+ @OneToMany
private Collection<Attribute> attributeCollection;
public AttributeGroup() {
this.attributeCollection = attributeCollection;
}
+ public static AttributeGroup fromAttributeGroupTO(AttributeGroupTO agto) {
+ AttributeGroup group = new AttributeGroup();
+ group.id = agto.getId();
+
+ group.attributeCollection = new ArrayList<>();
+ Collection<AttributeTO> attributes = agto.getAttributeCollection();
+ for (AttributeTO ato : attributes) {
+ group.attributeCollection.add(Attribute.fromAttributeTO(ato));
+ }
+
+ return group;
+ }
+
+ public AttributeGroupTO toAttributeGroupTO() {
+ AttributeGroupTO agto = new AttributeGroupTO();
+ agto.setId(this.id);
+
+ Collection<AttributeTO> atos = new ArrayList<>();
+ for (Attribute a : this.attributeCollection) {
+ atos.add(a.toAttributeTO());
+ }
+ agto.setAttributeCollection(atos);
+ return agto;
+ }
+
@Override
public String toString() {
return "com.edf.gde.entities.AttributeGroup[ id=" + id + " ]";
import java.util.Date;
import java.util.Objects;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author F62173
*/
@Entity(name = "File")
-@Table(name = "file")
+@Table(name = "gde_file")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "File.findAll", query = "SELECT f FROM File f"),
})
public class GDEFile implements Serializable {
private static final long serialVersionUID = 1L;
-
@Id
@Basic(optional = false)
@NotNull
@Column(name = "deletion_date")
@Temporal(TemporalType.TIMESTAMP)
private Date deletionDate;
- //@JoinColumn(name = "group_id", referencedColumnName = "id", nullable = false)
- @Column(name = "group_id", nullable = false)
- //@ManyToOne
- private long groupId;
- @OneToMany
- private Collection<Chunk> chunks;
-
+ @OneToMany(cascade = CascadeType.ALL)
+ private Collection<Chunk> chunkCollection;
+ @Column(name = "attribute_group_id")
+ private long attributeGroupId;
+
public GDEFile() {
}
this.deletionDate = deletionDate;
}
- public long getGroupId() {
- return groupId;
+ @XmlTransient
+ public Collection<Chunk> getChunkCollection() {
+ return chunkCollection;
}
- public void setGroupId(long groupId) {
- this.groupId = groupId;
+ public void setChunkCollection(Collection<Chunk> chunkCollection) {
+ this.chunkCollection = chunkCollection;
}
- public Collection<Chunk> getChunks() {
- return chunks;
+ public long getAttributeGroupId() {
+ return attributeGroupId;
}
- public void setChunks(Collection<Chunk> chunks) {
- this.chunks = chunks;
+ public void setAttributeGroupId(long attributeGroupId) {
+ this.attributeGroupId = attributeGroupId;
}
public static GDEFile fromFileTO(FileTO fto) {
GDEFile f = new GDEFile();
f.checksum = fto.getChecksum();
- f.chunks = new ArrayList<>();
- Collection<ChunkTO> chunks = fto.getChunks();
+ f.chunkCollection = new ArrayList<>();
+ Collection<ChunkTO> chunks = fto.getChunkCollection();
for (ChunkTO cto : chunks) {
- f.chunks.add(Chunk.fromChunkTO(cto));
+ f.chunkCollection.add(Chunk.fromChunkTO(cto));
}
f.creationDate = fto.getCreationDate();
f.deleted = fto.getDeleted();
f.deletionDate = fto.getDeletionDate();
- f.groupId = fto.getAttributeGroupId();
+ f.attributeGroupId = fto.getAttributeGroupId();
f.id = fto.getId();
f.length = fto.getLength();
f.name = fto.getName();
fto.setChecksum(this.checksum);
Collection<ChunkTO> ctos = new ArrayList<>();
- for (Chunk c : this.chunks) {
+ for (Chunk c : this.chunkCollection) {
ctos.add(c.toChunkTO());
}
- fto.setChunks(ctos);
+ fto.setChunkCollection(ctos);
fto.setCreationDate(this.creationDate);
fto.setDeleted(this.deleted);
fto.setDeletionDate(this.deletionDate);
- fto.setAttributeGroupId(this.groupId);
+ fto.setAttributeGroupId(this.attributeGroupId);
fto.setId(this.id);
fto.setLength(this.length);
fto.setName(this.name);
@Override
public String toString() {
- return "com.edf.gde.entities.File[ id=" + id + " ]";
+ return "com.edf.gde.entities.GDEFile[ id=" + id + " ]";
}
@Override
public int hashCode() {
- int hash = 5;
- hash = 41 * hash + (int) (this.id ^ (this.id >>> 32));
- hash = 41 * hash + Objects.hashCode(this.name);
- hash = 41 * hash + (int) (this.length ^ (this.length >>> 32));
- hash = 41 * hash + Objects.hashCode(this.checksum);
- hash = 41 * hash + Objects.hashCode(this.creationDate);
- hash = 41 * hash + Objects.hashCode(this.updateDate);
- hash = 41 * hash + Objects.hashCode(this.valid);
- hash = 41 * hash + Objects.hashCode(this.deleted);
- hash = 41 * hash + Objects.hashCode(this.deletionDate);
- hash = 41 * hash + (int) (this.groupId ^ (this.groupId >>> 32));
- hash = 41 * hash + Objects.hashCode(this.chunks);
+ int hash = 3;
+ hash = 29 * hash + (int) (this.id ^ (this.id >>> 32));
+ hash = 29 * hash + Objects.hashCode(this.name);
+ hash = 29 * hash + (int) (this.length ^ (this.length >>> 32));
+ hash = 29 * hash + Objects.hashCode(this.checksum);
+ hash = 29 * hash + Objects.hashCode(this.creationDate);
+ hash = 29 * hash + Objects.hashCode(this.updateDate);
+ hash = 29 * hash + Objects.hashCode(this.valid);
+ hash = 29 * hash + Objects.hashCode(this.deleted);
+ hash = 29 * hash + Objects.hashCode(this.deletionDate);
+ hash = 29 * hash + Objects.hashCode(this.chunkCollection);
+ hash = 29 * hash + (int) (this.attributeGroupId ^ (this.attributeGroupId >>> 32));
return hash;
}
--- /dev/null
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.edf.gde.entities;
+
+import com.edf.gde.transferables.StudyTO;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author F62173
+ */
+@Entity(name = "Study")
+@Table(name = "study")
+@XmlRootElement
+@NamedQueries({
+ @NamedQuery(name = "Study.findAll", query = "SELECT s FROM Study s"),
+ @NamedQuery(name = "Study.findById", query = "SELECT s FROM Study s WHERE s.id = :id"),
+ @NamedQuery(name = "Study.findByName", query = "SELECT s FROM Study s WHERE s.name = :name"),
+ @NamedQuery(name = "Study.findByCreationDate", query = "SELECT s FROM Study s WHERE s.creationDate = :creationDate"),
+ @NamedQuery(name = "Study.findByUpdateDate", query = "SELECT s FROM Study s WHERE s.updateDate = :updateDate"),
+ //@NamedQuery(name = "Study.findByValid", query = "SELECT s FROM Study s WHERE s.valid = :valid"),
+ //@NamedQuery(name = "Study.findByDeleted", query = "SELECT s FROM Study s WHERE s.deleted = :deleted"),
+ @NamedQuery(name = "Study.findByDeletionDate", query = "SELECT s FROM Study s WHERE s.deletionDate = :deletionDate")
+})
+public class Study implements Serializable {
+ private static final long serialVersionUID = 1L;
+ @Id
+ @Basic(optional = false)
+ @NotNull
+ @Column(name = "id")
+ private long id;
+ @Size(max = 255)
+ @Column(name = "name")
+ private String name;
+ @Column(name = "creation_date")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date creationDate;
+ @Column(name = "update_date")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date updateDate;
+ @Column(name = "valid")
+ private Boolean valid;
+ @Column(name = "deleted")
+ private Boolean deleted;
+ @Column(name = "deletion_date")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date deletionDate;
+ @Column(name = "attribute_group_id")
+ private long attributeGroupId;
+
+ public Study() {
+ }
+
+ public Study(long id) {
+ this.id = id;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(Date creationDate) {
+ this.creationDate = creationDate;
+ }
+
+ public Date getUpdateDate() {
+ return updateDate;
+ }
+
+ public void setUpdateDate(Date updateDate) {
+ this.updateDate = updateDate;
+ }
+
+ public Boolean getValid() {
+ return valid;
+ }
+
+ public void setValid(Boolean valid) {
+ this.valid = valid;
+ }
+
+ public Boolean getDeleted() {
+ return deleted;
+ }
+
+ public void setDeleted(Boolean deleted) {
+ this.deleted = deleted;
+ }
+
+ public Date getDeletionDate() {
+ return deletionDate;
+ }
+
+ public void setDeletionDate(Date deletionDate) {
+ this.deletionDate = deletionDate;
+ }
+
+ public long getAttributeGroupId() {
+ return attributeGroupId;
+ }
+
+ public void setAttributeGroupId(long attributeGroupId) {
+ this.attributeGroupId = attributeGroupId;
+ }
+
+ public static Study fromStudyTO(StudyTO sto) {
+ Study s = new Study();
+ s.creationDate = sto.getCreationDate();
+ s.deleted = sto.getDeleted();
+ s.deletionDate = sto.getDeletionDate();
+ s.attributeGroupId = sto.getAttributeGroupId();
+ s.id = sto.getId();
+ s.name = sto.getName();
+ s.updateDate = sto.getUpdateDate();
+ s.valid = sto.getValid();
+ return s;
+ }
+
+ public StudyTO toStudyTO() {
+ StudyTO sto = new StudyTO();
+ sto.setCreationDate(this.creationDate);
+ sto.setDeleted(this.deleted);
+ sto.setDeletionDate(this.deletionDate);
+ sto.setAttributeGroupId(this.attributeGroupId);
+ sto.setId(this.id);
+ sto.setName(this.name);
+ sto.setUpdateDate(this.updateDate);
+ sto.setValid(this.valid);
+ return sto;
+ }
+
+ @Override
+ public String toString() {
+ return "com.edf.gde.entities.Study[ id=" + id + " ]";
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 17 * hash + (int) (this.id ^ (this.id >>> 32));
+ hash = 17 * hash + Objects.hashCode(this.name);
+ hash = 17 * hash + Objects.hashCode(this.creationDate);
+ hash = 17 * hash + Objects.hashCode(this.updateDate);
+ hash = 17 * hash + Objects.hashCode(this.valid);
+ hash = 17 * hash + Objects.hashCode(this.deleted);
+ hash = 17 * hash + Objects.hashCode(this.deletionDate);
+ hash = 17 * hash + Objects.hashCode(this.attributeGroupId);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final Study other = (Study) obj;
+ if (this.id != other.id) {
+ return false;
+ }
+ return true;
+ }
+
+}
private Boolean deleted;
private Date deletionDate;
private long attributeGroupId;
- private Collection<ChunkTO> chunks;
+ private Collection<ChunkTO> chunkCollection;
public FileTO() {
}
- public FileTO(long id, String name, long length, String checksum, Date creationDate, Date updateDate, Boolean valid, Boolean deleted, Date deletionDate, long attributeGroupId, Collection<ChunkTO> chunks) {
+ public FileTO(long id, String name, long length, String checksum, Date creationDate, Date updateDate, Boolean valid, Boolean deleted, Date deletionDate, long attributeGroupId, Collection<ChunkTO> chunkCollection) {
this.id = id;
this.name = name;
this.length = length;
this.deleted = deleted;
this.deletionDate = deletionDate;
this.attributeGroupId = attributeGroupId;
- this.chunks = chunks;
+ this.chunkCollection = chunkCollection;
}
public long getId() {
this.attributeGroupId = attributeGroupId;
}
- public Collection<ChunkTO> getChunks() {
- return chunks;
+ public Collection<ChunkTO> getChunkCollection() {
+ return chunkCollection;
}
- public void setChunks(Collection<ChunkTO> chunks) {
- this.chunks = chunks;
+ public void setChunkCollection(Collection<ChunkTO> chunkCollection) {
+ this.chunkCollection = chunkCollection;
}
-
+
}
--- /dev/null
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.edf.gde.transferables;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Date;
+
+/**
+ *
+ * @author F62173
+ */
+public class StudyTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ private long id;
+ private String name;
+ private Date creationDate;
+ private Date updateDate;
+ private Boolean valid;
+ private Boolean deleted;
+ private Date deletionDate;
+ private long attributeGroupId;
+
+ public StudyTO() {
+ }
+
+ public StudyTO(long id, String name, Date creationDate, Date updateDate, Boolean valid, Boolean deleted, Date deletionDate, long attributeGroupId) {
+ this.id = id;
+ this.name = name;
+ this.creationDate = creationDate;
+ this.updateDate = updateDate;
+ this.valid = valid;
+ this.deleted = deleted;
+ this.deletionDate = deletionDate;
+ this.attributeGroupId = attributeGroupId;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(Date creationDate) {
+ this.creationDate = creationDate;
+ }
+
+ public Date getUpdateDate() {
+ return updateDate;
+ }
+
+ public void setUpdateDate(Date updateDate) {
+ this.updateDate = updateDate;
+ }
+
+ public Boolean getValid() {
+ return valid;
+ }
+
+ public void setValid(Boolean valid) {
+ this.valid = valid;
+ }
+
+ public Boolean getDeleted() {
+ return deleted;
+ }
+
+ public void setDeleted(Boolean deleted) {
+ this.deleted = deleted;
+ }
+
+ public Date getDeletionDate() {
+ return deletionDate;
+ }
+
+ public void setDeletionDate(Date deletionDate) {
+ this.deletionDate = deletionDate;
+ }
+
+ public long getAttributeGroupId() {
+ return attributeGroupId;
+ }
+
+ public void setAttributeGroupId(long attributeGroupId) {
+ this.attributeGroupId = attributeGroupId;
+ }
+
+}
${libs.javaee-endorsed-api-6.0.classpath}
j2ee.appclient.mainclass.args=${j2ee.appclient.tool.args}
j2ee.compile.on.save=true
-j2ee.deploy.on.save=true
+j2ee.deploy.on.save=false
j2ee.platform=1.7
j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
reference.GDE-ejb.dist-ear=${project.GDE-ejb}/dist/GDE-ejb.jar
reference.GDE-war.dist-ear=${project.GDE-war}/dist/GDE-war.war
resource.dir=setup
+run.classpath=
source.root=.
drop sequence SEQ_GEN_SEQUENCE;
create sequence SEQ_GEN_SEQUENCE INCREMENT BY 50;
+/* METADATA */
+
DROP TABLE attribute_group CASCADE;
CREATE TABLE attribute_group (
- id int8 PRIMARY KEY
+ id bigint NOT NULL PRIMARY KEY
);
DROP TABLE attribute CASCADE;
CREATE TABLE attribute (
- id int8 PRIMARY KEY,
+ id bigint NOT NULL PRIMARY KEY,
name varchar(255),
type varchar(255),
value varchar(255),
- group_id int8 REFERENCES attribute_group (id),
+ attribute_group_id bigint REFERENCES attribute_group (id),
mandatory boolean
);
-DROP TABLE file CASCADE;
-CREATE TABLE file (
- id int8 PRIMARY KEY,
+/* DATA */
+
+DROP TABLE gde_file CASCADE;
+CREATE TABLE gde_file (
+ id bigint NOT NULL PRIMARY KEY,
name varchar(255),
- length int8,
+ length bigint,
checksum varchar(255),
creation_date timestamp,
update_date timestamp,
valid boolean,
deleted boolean,
deletion_date timestamp,
- group_id int8 REFERENCES attribute_group (id)
+ attribute_group_id bigint REFERENCES attribute_group (id)
);
DROP TABLE chunk CASCADE;
CREATE TABLE chunk (
- id int8 PRIMARY KEY,
- file_id int8 REFERENCES file (id),
- rank int8,
+ id bigint NOT NULL PRIMARY KEY,
+ file_id bigint NOT NULL REFERENCES gde_file (id),
+ rank bigint,
checksum varchar(255),
- size int8,
+ size bigint,
data bytea
);
-/*
-DROP TABLE data CASCADE;
-CREATE TABLE data (
- file_id int8 REFERENCES file (id),
- metadata_id int8 REFERENCES attribute_group (id),
- PRIMARY KEY (file_id, metadata_id)
+
+/* STUDIES */
+
+DROP TABLE study CASCADE;
+CREATE TABLE study (
+ id bigint NOT NULL PRIMARY KEY,
+ name varchar(255),
+ creation_date timestamp,
+ update_date timestamp,
+ valid boolean,
+ deleted boolean,
+ deletion_date timestamp,
+ attribute_group_id bigint REFERENCES attribute_group (id)
);
-*/
+
+/* PROFILES */
+
DROP TABLE profile CASCADE;
CREATE TABLE profile (
- id int8 PRIMARY KEY,
+ id bigint NOT NULL PRIMARY KEY,
name varchar(255)
);
DROP TABLE profile_attribute CASCADE;
CREATE TABLE profile_attribute (
- id int8 PRIMARY KEY,
+ id bigint NOT NULL PRIMARY KEY,
name varchar(255),
type varchar(255),
mandatory boolean,
- profile_id int8 REFERENCES profile (id)
+ profile_id bigint REFERENCES profile (id)
);