Salome HOME
Fixe GDEFile
[modules/gde.git] / projects / GDE_App / GDE-ejb / src / java / com / edf / gde / entities / GDEFile.java
index c7851b7adde1d97d954888c2e7d283d7bf6e2dc9..824c50e79cfdadc762a7a9e33aaa48ac8fe36845 100644 (file)
@@ -69,9 +69,9 @@ public class GDEFile implements Serializable {
     @Temporal(TemporalType.TIMESTAMP)
     private Date deletionDate;
     @Column(name = "attribute_group_id")
-    private long attributeGroupId;
+    private Long attributeGroupId;
     @Column(name = "data_profile_id")
-    private long dataProfileId;
+    private Long dataProfileId;
     // No member for chunks: data are accessed with SQL requests
     
     public GDEFile() {
@@ -153,19 +153,19 @@ public class GDEFile implements Serializable {
         this.deletionDate = deletionDate;
     }
 
-    public long getAttributeGroupId() {
+    public Long getAttributeGroupId() {
         return attributeGroupId;
     }
 
-    public void setAttributeGroupId(long attributeGroupId) {
+    public void setAttributeGroupId(Long attributeGroupId) {
         this.attributeGroupId = attributeGroupId;
     }
 
-    public long getDataProfileId() {
+    public Long getDataProfileId() {
         return dataProfileId;
     }
 
-    public void setDataProfileId(long dataProfileId) {
+    public void setDataProfileId(Long dataProfileId) {
         this.dataProfileId = dataProfileId;
     }
 
@@ -175,13 +175,13 @@ public class GDEFile implements Serializable {
         f.creationDate = fto.getCreationDate();
         f.deleted = fto.getDeleted();
         f.deletionDate = fto.getDeletionDate();
-        f.attributeGroupId = fto.getAttributeGroupId();
+        f.attributeGroupId = fto.getAttributeGroupId()==0?null:fto.getAttributeGroupId();
         f.id = fto.getId();
         f.length = fto.getLength();
         f.name = fto.getName();
         f.updateDate = fto.getUpdateDate();
         f.valid = fto.getValid();
-        f.dataProfileId = fto.getDataProfileId();
+        f.dataProfileId = fto.getDataProfileId()==0?null:fto.getDataProfileId();
         return f;
     }
 
@@ -191,13 +191,13 @@ public class GDEFile implements Serializable {
         fto.setCreationDate(this.creationDate);
         fto.setDeleted(this.deleted);
         fto.setDeletionDate(this.deletionDate);
-        fto.setAttributeGroupId(this.attributeGroupId);
+        fto.setAttributeGroupId(this.attributeGroupId==null?0:this.attributeGroupId);
         fto.setId(this.id);
         fto.setLength(this.length);
         fto.setName(this.name);
         fto.setUpdateDate(this.updateDate);
         fto.setValid(this.valid);
-        fto.setDataProfileId(this.dataProfileId);
+        fto.setDataProfileId(this.dataProfileId==null?0:this.dataProfileId);
         return fto;
     }
 
@@ -208,18 +208,9 @@ public class GDEFile implements Serializable {
 
     @Override
     public int hashCode() {
-        int hash = 5;
-        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));
+        int hash = 7;
+        hash = 67 * hash + (int) (this.id ^ (this.id >>> 32));
+        hash = 67 * hash + Objects.hashCode(this.name);
         return hash;
     }