/** Fetch the current groupUserRole row from a resultSet. */
  protected GroupUserRoleRow fetchGroupUserRole(ResultSet rs) throws SQLException {
    GroupUserRoleRow sur = new GroupUserRoleRow();

    sur.id = rs.getInt(1);
    sur.groupId = rs.getInt(2);
    sur.roleName = rs.getString(3);
    return sur;
  }
  @Override
  protected void prepareInsert(String insertQuery, PreparedStatement insert, GroupUserRoleRow usr)
      throws SQLException {
    if (usr.id == -1) {
      usr.id = getNextId();
    }

    insert.setInt(1, usr.id);
    insert.setInt(2, usr.groupId);
    if (!StringUtil.isDefined(usr.roleName)) {
      // column "rolename" is not null
      usr.roleName = "useless";
    }
    insert.setString(3, usr.roleName);
  }