1 package org.manentia.kasai; 2 3 import java.sql.ResultSet ; 4 import java.sql.SQLException ; 5 6 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 23 public ObjectGroupRole(ResultSet rs) throws SQLException { 24 id = rs.getInt("id"); 25 object =rs.getString ("id_object"); 26 role =rs.getInt ("id_role"); 27 group =rs.getString ("id_group"); 28 roleName =rs.getString ("role_name"); 29 } 30 31 public String getObject() { 32 return object; 33 } 34 35 public void setObject(String object) { 36 this.object = object; 37 } 38 39 public int getRole() { 40 return role; 41 } 42 43 public void setRole(int role) { 44 this.role = role; 45 } 46 47 public String getGroup() { 48 return group; 49 } 50 51 public void setGroup(String group) { 52 this.group = group; 53 } 54 55 56 public int getId() { 57 return id; 58 } 59 60 public void setId(int id) { 61 this.id = id; 62 } 63 64 public boolean equals (java.lang.Object obj){ 65 boolean result = false; 66 ObjectGroupRole ogr; 67 try{ 68 if (obj instanceof ObjectGroupRole){ 69 ogr = (ObjectGroupRole)obj; 70 result = (ogr.getId() == this.id); 71 72 if (!result){ 73 result = (ogr.getGroup().equals(this.getGroup())) && 74 (ogr.getObject().equals(this.getObject())) && 75 (ogr.getRole() == (this.getRole())); 76 } 77 } 78 79 } 80 catch (Exception e){ 81 result = false; 82 } 83 return result; 84 } 85 86 public java.lang.String getRoleName() { 87 return roleName; 88 } 89 90 public void setRoleName(java.lang.String roleName) { 91 this.roleName = roleName; 92 } 93 94 } 95 | Popular Tags |