/** getEntityFromHashMap, the method that gets the object from the database query. */
  public Object getEntityFromHashMap(HashMap hm) {
    DiscrepancyNoteBean eb = new DiscrepancyNoteBean();
    Date dateCreated = (Date) hm.get("date_created");
    Integer ownerId = (Integer) hm.get("owner_id");
    eb.setCreatedDate(dateCreated);
    eb.setOwnerId(ownerId.intValue());

    // discrepancy_note_id serial NOT NULL,
    // description varchar(255),
    // discrepancy_note_type_id numeric,
    // resolution_status_id numeric,

    // detailed_notes varchar(1000),
    // date_created date,
    // owner_id numeric,
    // parent_dn_id numeric,
    eb.setId(selectInt(hm, "discrepancy_note_id"));
    eb.setDescription((String) hm.get("description"));
    eb.setDiscrepancyNoteTypeId(((Integer) hm.get("discrepancy_note_type_id")).intValue());
    eb.setResolutionStatusId(((Integer) hm.get("resolution_status_id")).intValue());
    eb.setParentDnId(((Integer) hm.get("parent_dn_id")).intValue());
    eb.setDetailedNotes((String) hm.get("detailed_notes"));
    eb.setEntityType((String) hm.get("entity_type"));
    eb.setDisType(DiscrepancyNoteType.get(eb.getDiscrepancyNoteTypeId()));
    eb.setResStatus(ResolutionStatus.get(eb.getResolutionStatusId()));
    eb.setStudyId(selectInt(hm, "study_id"));
    return eb;
  }