/** Updates a single row in the SessionSexualRelationshipType table. */
 @Transactional
 public void update(SessionSexualRelationshipTypePk pk, SessionSexualRelationshipType dto)
     throws SessionSexualRelationshipTypeDaoException {
   jdbcTemplate.update(
       "UPDATE "
           + getTableName()
           + " SET sessionSexualRelationshipTypeId = ?, sessionReference = ?, sexualRelationshipTypeId = ?, dateCreated = ?, createdBy = ?, dateModified = ?, modifiedBy = ?, status = ? WHERE sessionSexualRelationshipTypeId = ?",
       dto.getSessionSexualRelationshipTypeId(),
       dto.getSessionReference(),
       dto.getSexualRelationshipTypeId(),
       dto.getDateCreated(),
       dto.getCreatedBy(),
       dto.getDateModified(),
       dto.getModifiedBy(),
       dto.getStatus(),
       pk.getSessionSexualRelationshipTypeId());
 }
  /**
   * Method 'mapRow'
   *
   * @param rs
   * @param row
   * @throws SQLException
   * @return SessionSexualRelationshipType
   */
  public SessionSexualRelationshipType mapRow(ResultSet rs, int row) throws SQLException {
    SessionSexualRelationshipType dto = new SessionSexualRelationshipType();
    dto.setSessionSexualRelationshipTypeId(rs.getLong(1));
    dto.setSessionReference(rs.getString(2));
    dto.setSexualRelationshipTypeId(rs.getLong(3));
    if (rs.wasNull()) {
      dto.setSexualRelationshipTypeIdNull(true);
    }

    dto.setDateCreated(rs.getTimestamp(4));
    dto.setCreatedBy(rs.getString(5));
    dto.setDateModified(rs.getTimestamp(6));
    dto.setModifiedBy(rs.getString(7));
    dto.setStatus(rs.getInt(8));
    if (rs.wasNull()) {
      dto.setStatusNull(true);
    }

    return dto;
  }
 /**
  * Method 'insert'
  *
  * @param dto
  * @return SessionSexualRelationshipTypePk
  */
 @Transactional
 public SessionSexualRelationshipTypePk insert(SessionSexualRelationshipType dto) {
   jdbcTemplate.update(
       "INSERT INTO "
           + getTableName()
           + " ( sessionSexualRelationshipTypeId, sessionReference, sexualRelationshipTypeId, dateCreated, createdBy, dateModified, modifiedBy, status ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ? )",
       dto.getSessionSexualRelationshipTypeId(),
       dto.getSessionReference(),
       dto.isSexualRelationshipTypeIdNull() ? null : dto.getSexualRelationshipTypeId(),
       dto.getDateCreated(),
       dto.getCreatedBy(),
       dto.getDateModified(),
       dto.getModifiedBy(),
       dto.isStatusNull() ? null : dto.getStatus());
   return dto.createPk();
 }