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 ObjectGroupRole {
12:
13: private int id;
14: private String object;
15: private int role;
16: private String roleName;
17: private String group;
18:
19: public ObjectGroupRole() {
20: }
21:
22: public ObjectGroupRole(ResultSet rs) throws SQLException {
23: id = rs.getInt("id");
24: object = rs.getString("id_object");
25: role = rs.getInt("id_role");
26: group = rs.getString("id_group");
27: roleName = rs.getString("role_name");
28: }
29:
30: public String getObject() {
31: return object;
32: }
33:
34: public void setObject(String object) {
35: this .object = object;
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 getGroup() {
47: return group;
48: }
49:
50: public void setGroup(String group) {
51: this .group = group;
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: ObjectGroupRole ogr;
65: try {
66: if (obj instanceof ObjectGroupRole) {
67: ogr = (ObjectGroupRole) obj;
68: result = (ogr.getId() == this .id);
69:
70: if (!result) {
71: result = (ogr.getGroup().equals(this .getGroup()))
72: && (ogr.getObject()
73: .equals(this .getObject()))
74: && (ogr.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: }
|