airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dimuthu...@apache.org
Subject [airavata] branch develop updated: Adding missing User entity for registry refactoring module
Date Mon, 27 Aug 2018 20:50:19 GMT
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new a508aa2  Adding missing User entity for registry refactoring module
a508aa2 is described below

commit a508aa29018c17cd228efeea88f7679f81abffdf
Author: dimuthu <dimuthu.upeksha2@gmail.com>
AuthorDate: Mon Aug 27 16:50:12 2018 -0400

    Adding missing User entity for registry refactoring module
---
 .../entities/expcatalog/ProjectUserEntity.java     | 12 +++++
 .../registry/core/entities/expcatalog/UserPK.java  | 50 +++++++++++++++++
 .../core/entities/expcatalog/UsersEntity.java      | 62 ++++++++++++++++++++++
 3 files changed, 124 insertions(+)

diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProjectUserEntity.java
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProjectUserEntity.java
index a371d2a..3c24b27 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProjectUserEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProjectUserEntity.java
@@ -43,6 +43,10 @@ public class ProjectUserEntity implements Serializable {
     public ProjectUserEntity() {
     }
 
+    @ManyToOne(targetEntity = UsersEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+    @JoinColumn(name = "USER_NAME", referencedColumnName = "USER_NAME")
+    private UsersEntity user;
+
     public String getProjectID() {
         return projectID;
     }
@@ -58,4 +62,12 @@ public class ProjectUserEntity implements Serializable {
     public void setUserName(String userName) {
         this.userName = userName;
     }
+
+    public UsersEntity getUser() {
+        return user;
+    }
+
+    public void setUser(UsersEntity user) {
+        this.user = user;
+    }
 }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UserPK.java
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UserPK.java
new file mode 100644
index 0000000..9c345b9
--- /dev/null
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UserPK.java
@@ -0,0 +1,50 @@
+package org.apache.airavata.registry.core.entities.expcatalog;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+public class UserPK {
+    private String gatewayId;
+    private String userName;
+
+    @Id
+    @Column(name = "GATEWAY_ID")
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+
+    @Id
+    @Column(name = "USER_NAME")
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        UserPK that = (UserPK) o;
+
+        if (getGatewayId() != null ? !getGatewayId().equals(that.getGatewayId()) : that.getGatewayId()
!= null) return false;
+        if (getUserName() != null ? !getUserName().equals(that.getUserName()) : that.getUserName()
!= null) return false;
+
+        return true;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = getGatewayId() != null ? getGatewayId().hashCode() : 0;
+        result = 31 * result + (getUserName() != null ? getUserName().hashCode() : 0);
+        return result;
+    }
+}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UsersEntity.java
b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UsersEntity.java
new file mode 100644
index 0000000..682120e
--- /dev/null
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/UsersEntity.java
@@ -0,0 +1,62 @@
+package org.apache.airavata.registry.core.entities.expcatalog;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "USERS")
+@IdClass(UserPK.class)
+public class UsersEntity {
+    private String airavataInternalUserId;
+    private String userName;
+    private String password;
+    private String gatewayId;
+    private GatewayEntity gateway;
+
+    @Id
+    @Column(name = "USER_NAME")
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    @Id
+    @Column(name = "GATEWAY_ID")
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+    @Column(name = "AIRAVATA_INTERNAL_USER_ID")
+    public String getAiravataInternalUserId() {
+        return airavataInternalUserId;
+    }
+
+    public void setAiravataInternalUserId(String airavataInternalUserId) {
+        this.airavataInternalUserId = airavataInternalUserId;
+    }
+
+    @Column(name = "PASSWORD")
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    @JoinColumn(name = "GATEWAY_ID", referencedColumnName = "GATEWAY_ID")
+    @ManyToOne(optional = false, cascade = {CascadeType.PERSIST})
+    public GatewayEntity getGateway() {
+        return gateway;
+    }
+
+    public void setGateway(GatewayEntity gateway) {
+        this.gateway = gateway;
+    }
+}


Mime
View raw message