@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SelfAssessmentStatistic selfAssessmentStatistic = (SelfAssessmentStatistic) o; return selfAssessment.equals(selfAssessmentStatistic.selfAssessment) && spiritualPurposeCategory.equals(selfAssessmentStatistic.spiritualPurposeCategory); }
public void lookup(int orgid, int year, DbConn myConn) { String outLine = ""; ResultSet rs = null; Statement stmt = null; // get *active* organizations // get organization name and acronym try { Connection conn = myConn.conn; stmt = conn.createStatement(); String sqlcode = null; String wherestring = null; String orderby = " order by name "; if (orgid > 0) { wherestring = " where isactive = 'T' AND id=" + orgid; sqlcode = "SELECT id, name, acronym, isactive, porgid FROM " + SCHEMAPATH + ".ORGANIZATION " + wherestring; } else { wherestring = " where isactive = 'T'"; sqlcode = "SELECT id, name, acronym, isactive, porgid FROM " + SCHEMAPATH + ".ORGANIZATION " + wherestring + orderby; } // System.out.println(sqlcode); rs = stmt.executeQuery(sqlcode); while (rs.next()) { System.out.println( "/************** " + rs.getString("name") + ", " + rs.getInt("id") + " **************/"); SelfAssessment sa = new SelfAssessment(); SelfAssessment[] item = sa.getSAList(myConn, "id", 0, orgid, year); for (int i = 0; i < item.length; i++) { System.out.println("/**************" + "**************/"); sanumber = item[i].getSANumber(item[i].getOrgid(), item[i].getDivid(), myConn); System.out.println("sanumber: " + sanumber); teamleadid = Integer.valueOf(item[i].getTeamleadid()); String teamleadname = null; teamleadname = item[i].getTeamleadname(teamleadid, myConn); System.out.println("teamleadname: " + teamleadname); title = item[i].getTitle(); System.out.println("title: " + title); purpose = item[i].getPurpose(); System.out.println("purpose: " + purpose); scheduleddate = item[i].getScheduleddate(); System.out.println("scheduleddate: " + scheduleddate); rescheduleddate = item[i].getRescheduleddate(); System.out.println("rescheduleddate: " + rescheduleddate); signeddate = item[i].getSigneddate(); System.out.println("signeddate: " + signeddate); cancelleddate = item[i].getCancelleddate(); System.out.println("cancelleddate: " + cancelleddate); cancelledrationale = item[i].getCancelledrationale(); System.out.println("cancelledrationale: " + cancelledrationale); comments = item[i].getComments(); System.out.println("comments: " + comments); hascirs = item[i].getHascirs(); System.out.println("hascirs: " + hascirs); asstype = item[i].getAsstype(); System.out.println("asstype: " + asstype); assobj = item[i].getAssobj(); System.out.println("assobj: " + assobj); crlevels = item[i].getCrlevels(); System.out.println("crlevels: " + crlevels); crnums = item[i].getCrnums(); System.out.println("crnums: " + crnums); llnums = item[i].getLlnums(); System.out.println("llnums: " + llnums); } } } catch (SQLException e) { outLine = outLine + "SQLException caught: " + e.getMessage(); // log(outLine); // gov.ymp.csi.db.ALog.logError(myConn, 0,"N/A",0, outLine + " - SelfAssessment lookup"); } catch (Exception e) { outLine = outLine + "Exception caught: " + e.getMessage(); // log(outLine); // gov.ymp.csi.db.ALog.logError(myConn, 0,"N/A",0, outLine); } finally { if (rs != null) try { rs.close(); } catch (Exception i) { } if (stmt != null) try { stmt.close(); } catch (Exception i) { } } }
@Override public int hashCode() { return 13 * selfAssessment.hashCode(); }