From: Cédric Aguerre Date: Fri, 17 Jul 2015 13:49:17 +0000 (+0200) Subject: Link to profiles X-Git-Tag: gde-v0.1~36 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c22ed435683a0ca11711202da303cd6e8e5eabcb;p=modules%2Fgde.git Link to profiles --- diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/GDEFile.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/GDEFile.java index dcb0d31..ceb8c9e 100644 --- a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/GDEFile.java +++ b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/GDEFile.java @@ -76,6 +76,8 @@ public class GDEFile implements Serializable { private Date deletionDate; @Column(name = "attribute_group_id") private long attributeGroupId; + @Column(name = "data_profile_id") + private long dataProfileId; // No member for chunks: data are accessed with SQL requests public GDEFile() { @@ -165,6 +167,14 @@ public class GDEFile implements Serializable { this.attributeGroupId = attributeGroupId; } + public long getDataProfileId() { + return dataProfileId; + } + + public void setDataProfileId(long dataProfileId) { + this.dataProfileId = dataProfileId; + } + public static GDEFile fromFileTO(FileTO fto) { GDEFile f = new GDEFile(); f.checksum = fto.getChecksum(); @@ -177,6 +187,7 @@ public class GDEFile implements Serializable { f.name = fto.getName(); f.updateDate = fto.getUpdateDate(); f.valid = fto.getValid(); + f.dataProfileId = fto.getDataProfileId(); return f; } @@ -192,6 +203,7 @@ public class GDEFile implements Serializable { fto.setName(this.name); fto.setUpdateDate(this.updateDate); fto.setValid(this.valid); + fto.setDataProfileId(this.dataProfileId); return fto; } @@ -203,16 +215,17 @@ public class GDEFile implements Serializable { @Override public int hashCode() { int hash = 5; - hash = 79 * hash + (int) (this.id ^ (this.id >>> 32)); - hash = 79 * hash + Objects.hashCode(this.name); - hash = 79 * hash + (int) (this.length ^ (this.length >>> 32)); - hash = 79 * hash + Objects.hashCode(this.checksum); - hash = 79 * hash + Objects.hashCode(this.creationDate); - hash = 79 * hash + Objects.hashCode(this.updateDate); - hash = 79 * hash + Objects.hashCode(this.valid); - hash = 79 * hash + Objects.hashCode(this.deleted); - hash = 79 * hash + Objects.hashCode(this.deletionDate); - hash = 79 * hash + (int) (this.attributeGroupId ^ (this.attributeGroupId >>> 32)); + hash = 23 * hash + (int) (this.id ^ (this.id >>> 32)); + hash = 23 * hash + Objects.hashCode(this.name); + hash = 23 * hash + (int) (this.length ^ (this.length >>> 32)); + hash = 23 * hash + Objects.hashCode(this.checksum); + hash = 23 * hash + Objects.hashCode(this.creationDate); + hash = 23 * hash + Objects.hashCode(this.updateDate); + hash = 23 * hash + Objects.hashCode(this.valid); + hash = 23 * hash + Objects.hashCode(this.deleted); + hash = 23 * hash + Objects.hashCode(this.deletionDate); + hash = 23 * hash + (int) (this.attributeGroupId ^ (this.attributeGroupId >>> 32)); + hash = 23 * hash + (int) (this.dataProfileId ^ (this.dataProfileId >>> 32)); return hash; } diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Study.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Study.java index 1fc4661..75f2d75 100644 --- a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Study.java +++ b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Study.java @@ -69,6 +69,8 @@ public class Study implements Serializable { private Date deletionDate; @Column(name = "attribute_group_id") private long attributeGroupId; + @Column(name = "profile_id") + private long profileId; public Study() { } @@ -141,6 +143,14 @@ public class Study implements Serializable { this.attributeGroupId = attributeGroupId; } + public long getProfileId() { + return profileId; + } + + public void setProfileId(long profileId) { + this.profileId = profileId; + } + public static Study fromStudyTO(StudyTO sto) { Study s = new Study(); s.creationDate = sto.getCreationDate(); @@ -151,6 +161,7 @@ public class Study implements Serializable { s.name = sto.getName(); s.updateDate = sto.getUpdateDate(); s.valid = sto.getValid(); + s.profileId = sto.getProfileId(); return s; } @@ -164,6 +175,7 @@ public class Study implements Serializable { sto.setName(this.name); sto.setUpdateDate(this.updateDate); sto.setValid(this.valid); + sto.setProfileId(this.profileId); return sto; } @@ -175,14 +187,15 @@ public class Study implements Serializable { @Override public int hashCode() { int hash = 7; - hash = 41 * hash + (int) (this.id ^ (this.id >>> 32)); - hash = 41 * hash + Objects.hashCode(this.name); - 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.attributeGroupId ^ (this.attributeGroupId >>> 32)); + hash = 11 * hash + (int) (this.id ^ (this.id >>> 32)); + hash = 11 * hash + Objects.hashCode(this.name); + hash = 11 * hash + Objects.hashCode(this.creationDate); + hash = 11 * hash + Objects.hashCode(this.updateDate); + hash = 11 * hash + Objects.hashCode(this.valid); + hash = 11 * hash + Objects.hashCode(this.deleted); + hash = 11 * hash + Objects.hashCode(this.deletionDate); + hash = 11 * hash + (int) (this.attributeGroupId ^ (this.attributeGroupId >>> 32)); + hash = 11 * hash + (int) (this.profileId ^ (this.profileId >>> 32)); return hash; } diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/FileTO.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/FileTO.java index a48b145..e7cb272 100644 --- a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/FileTO.java +++ b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/FileTO.java @@ -27,11 +27,12 @@ public class FileTO implements Serializable { private Date deletionDate; private long attributeGroupId; private Collection chunkCollection; + private long dataProfileId; 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 chunkCollection) { + public FileTO(long id, String name, long length, String checksum, Date creationDate, Date updateDate, Boolean valid, Boolean deleted, Date deletionDate, long attributeGroupId, Collection chunkCollection, long dataProfileId) { this.id = id; this.name = name; this.length = length; @@ -43,6 +44,7 @@ public class FileTO implements Serializable { this.deletionDate = deletionDate; this.attributeGroupId = attributeGroupId; this.chunkCollection = chunkCollection; + this.dataProfileId = dataProfileId; } public long getId() { @@ -133,4 +135,12 @@ public class FileTO implements Serializable { this.chunkCollection = chunkCollection; } + public long getDataProfileId() { + return dataProfileId; + } + + public void setDataProfileId(long dataProfileId) { + this.dataProfileId = dataProfileId; + } + } diff --git a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/StudyTO.java b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/StudyTO.java index 8edead3..edf2d66 100644 --- a/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/StudyTO.java +++ b/projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/StudyTO.java @@ -24,11 +24,12 @@ public class StudyTO implements Serializable { private Boolean deleted; private Date deletionDate; private long attributeGroupId; + private long profileId; public StudyTO() { } - public StudyTO(long id, String name, Date creationDate, Date updateDate, Boolean valid, Boolean deleted, Date deletionDate, long attributeGroupId) { + public StudyTO(long id, String name, Date creationDate, Date updateDate, Boolean valid, Boolean deleted, Date deletionDate, long attributeGroupId, long profileId) { this.id = id; this.name = name; this.creationDate = creationDate; @@ -37,6 +38,7 @@ public class StudyTO implements Serializable { this.deleted = deleted; this.deletionDate = deletionDate; this.attributeGroupId = attributeGroupId; + this.profileId = profileId; } public long getId() { @@ -102,5 +104,13 @@ public class StudyTO implements Serializable { public void setAttributeGroupId(long attributeGroupId) { this.attributeGroupId = attributeGroupId; } + + public long getProfileId() { + return profileId; + } + + public void setProfileId(long profileId) { + this.profileId = profileId; + } } diff --git a/projects/GDE_App/src/GDE_DB_Init.sql b/projects/GDE_App/src/GDE_DB_Init.sql index a85ba4a..61efacf 100644 --- a/projects/GDE_App/src/GDE_DB_Init.sql +++ b/projects/GDE_App/src/GDE_DB_Init.sql @@ -35,7 +35,8 @@ CREATE TABLE gde_file ( valid boolean, deleted boolean, deletion_date timestamp, - attribute_group_id bigint REFERENCES attribute_group (id) + attribute_group_id bigint REFERENCES attribute_group (id), + data_profile_id bigint REFERENCES profile (id) ); DROP TABLE IF EXISTS chunk CASCADE; @@ -59,7 +60,8 @@ CREATE TABLE study ( valid boolean, deleted boolean, deletion_date timestamp, - attribute_group_id bigint REFERENCES attribute_group (id) + attribute_group_id bigint REFERENCES attribute_group (id), + profile_id bigint REFERENCES profile (id) ); /* PROFILES */