Added Added initial files for entities,repositories for allocation manager module
[airavata-sandbox.git] / allocation-manager / allocation-manager-server / src / main / java / org / apache / airavata / allocation / manager / db / entities / UserAllocationDetailPKEntity.java
1 package org.apache.airavata.allocation.manager.db.entities;
2
3 import java.io.Serializable;
4 import javax.persistence.*;
5
6 /**
7 * The primary key class for the user_allocation_details database table.
8 *
9 */
10 @Embeddable
11 public class UserAllocationDetailPK implements Serializable {
12 //default serial version id, required for serializable classes.
13 private static final long serialVersionUID = 1L;
14
15 @Column(name="PROJECT_ID")
16 private String projectId;
17
18 private String username;
19
20 public UserAllocationDetailPK() {
21 }
22 public String getProjectId() {
23 return this.projectId;
24 }
25 public void setProjectId(String projectId) {
26 this.projectId = projectId;
27 }
28 public String getUsername() {
29 return this.username;
30 }
31 public void setUsername(String username) {
32 this.username = username;
33 }
34
35 public boolean equals(Object other) {
36 if (this == other) {
37 return true;
38 }
39 if (!(other instanceof UserAllocationDetailPK)) {
40 return false;
41 }
42 UserAllocationDetailPK castOther = (UserAllocationDetailPK)other;
43 return
44 this.projectId.equals(castOther.projectId)
45 && this.username.equals(castOther.username);
46 }
47
48 public int hashCode() {
49 final int prime = 31;
50 int hash = 17;
51 hash = hash * prime + this.projectId.hashCode();
52 hash = hash * prime + this.username.hashCode();
53
54 return hash;
55 }
56 }