]> SALOME platform Git repositories - modules/gde.git/commitdiff
Salome HOME
Link to profiles
authorCédric Aguerre <cedric.aguerre@edf.fr>
Fri, 17 Jul 2015 13:49:17 +0000 (15:49 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Fri, 17 Jul 2015 13:49:17 +0000 (15:49 +0200)
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/GDEFile.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/Study.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/FileTO.java
projects/GDE_App/GDE-ejb/src/java/com/edf/gde/transferables/StudyTO.java
projects/GDE_App/src/GDE_DB_Init.sql

index dcb0d31dff83af15dbdbe56e2367db353f0de07f..ceb8c9e1f31d27d0792153aa478031733c2b1388 100644 (file)
@@ -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;
     }
 
index 1fc4661d60a27259be1b216589104c8eff34ce7f..75f2d7503547399eb558a972bfcd51c9dabb9338 100644 (file)
@@ -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;
     }
 
index a48b14575c802fd128ba2a3d06be65b242f845f2..e7cb27299aa50ddd30d9b8ce5049b69ba0a3d803 100644 (file)
@@ -27,11 +27,12 @@ public class FileTO implements Serializable {
     private Date deletionDate;
     private long attributeGroupId;
     private Collection<ChunkTO> 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<ChunkTO> chunkCollection) {
+    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, 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;
+    }
+
 }
index 8edead39e7949aae05212240c21d23faa975b04d..edf2d66e4f4e448ae169c25436ec5785e5a8dfb2 100644 (file)
@@ -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;
+    }
     
 }
index a85ba4a5f07f5d9371c24bfa1912618c361773d4..61efacf96a44add795e8e622a9125c07662076cb 100644 (file)
@@ -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 */