Repository: airavata Updated Branches: refs/heads/develop d678f4fc1 -> 84f756d41
adding composite primary key to model class Project: http://git-wip-us.apache.org/repos/asf/airavata/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/98378b53 Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/98378b53 Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/98378b53 Branch: refs/heads/develop Commit: 98378b53e4e1da69e61f8149e51093eab94013a0 Parents: d678f4f Author: Anuj Bhandar <[email protected]> Authored: Thu Dec 1 17:48:24 2016 -0500 Committer: Anuj Bhandar <[email protected]> Committed: Thu Dec 1 17:48:24 2016 -0500 ---------------------------------------------------------------------- .../app/catalog/model/UserResourceProfile.java | 10 ++- .../catalog/model/UserResourceProfilePK.java | 66 ++++++++++++++++++++ 2 files changed, 70 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata/blob/98378b53/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfile.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfile.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfile.java index 9156168..5d1d085 100644 --- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfile.java +++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfile.java @@ -21,22 +21,20 @@ package org.apache.airavata.registry.core.app.catalog.model; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import javax.persistence.*; import java.io.Serializable; import java.sql.Timestamp; @Entity @Table(name = "USER_RESOURCE_PROFILE") -public class UserResourceProfile implements Serializable { +@IdClass(UserResourceProfilePK.class) +public class UserResourceProfile { @Id @Column(name = "USER_ID") private String userId; - + @Id @Column(name = "GATEWAY_ID") private String gatewayID; http://git-wip-us.apache.org/repos/asf/airavata/blob/98378b53/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfilePK.java ---------------------------------------------------------------------- diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfilePK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfilePK.java new file mode 100644 index 0000000..af90e50 --- /dev/null +++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UserResourceProfilePK.java @@ -0,0 +1,66 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +package org.apache.airavata.registry.core.app.catalog.model; + +import java.io.Serializable; + +public class UserResourceProfilePK implements Serializable { + + private String userId; + + private String gatewayID; + + public UserResourceProfilePK(String userId, String gatewayID) { + this.userId = userId; + this.gatewayID = gatewayID; + } + + public UserResourceProfilePK() { + } + + @Override + public boolean equals(Object o) { + return false; + } + + @Override + public int hashCode() { + return 1; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getGatewayID() { + return gatewayID; + } + + public void setGatewayID(String gatewayID) { + this.gatewayID = gatewayID; + } + +}
