01: package org.manentia.kasai;
02:
03: import java.sql.ResultSet;
04: import java.sql.SQLException;
05:
06: /**
07: *
08: * @author fpena
09: *
10: */
11: public class ObjectUserRole {
12:
13: private int id;
14: private String objectId;
15: private int role;
16: private String roleName;
17: private String user;
18:
19: public ObjectUserRole() {
20: }
21:
22: public ObjectUserRole(ResultSet rs) throws SQLException {
23: id = rs.getInt("id");
24: objectId = rs.getString("id_object");
25: role = rs.getInt("id_role");
26: user = rs.getString("id_user");
27: roleName = rs.getString("role_name");
28: }
29:
30: public String getObjectId() {
31: return objectId;
32: }
33:
34: public void setObjectId(String objectId) {
35: this .objectId = objectId;
36: }
37:
38: public int getRole() {
39: return role;
40: }
41:
42: public void setRole(int role) {
43: this .role = role;
44: }
45:
46: public String getUser() {
47: return user;
48: }
49:
50: public void setUser(String user) {
51: this .user = user;
52: }
53:
54: public int getId() {
55: return id;
56: }
57:
58: public void setId(int id) {
59: this .id = id;
60: }
61:
62: public boolean equals(java.lang.Object obj) {
63: boolean result = false;
64: ObjectUserRole our;
65: try {
66: if (obj instanceof ObjectUserRole) {
67: our = (ObjectUserRole) obj;
68: result = (our.getId() == this .id);
69:
70: if (!result) {
71: result = (our.getUser().equals(this .getUser()))
72: && (our.getObjectId().equals(this
73: .getObjectId()))
74: && (our.getRole() == (this .getRole()));
75: }
76: }
77:
78: } catch (Exception e) {
79: result = false;
80: }
81: return result;
82: }
83:
84: public java.lang.String getRoleName() {
85: return roleName;
86: }
87:
88: public void setRoleName(java.lang.String roleName) {
89: this.roleName = roleName;
90: }
91:
92: }
|