Ejemplo n.º 1
0
  protected LumberLog fromResultSet(ResultSet rs) throws SQLException {
    LumberLog lumberLog = new LumberLog();
    lumberLog.setId(rs.getLong("id"));
    lumberLog.setLength(rs.getDouble("length"));
    lumberLog.setRealLength(rs.getLong("reallength"));
    lumberLog.setVolume(rs.getDouble("volume"));
    lumberLog.setRealVolume(rs.getDouble("realvolume"));
    lumberLog.setSmallRadius(rs.getDouble("small_diameter"));
    lumberLog.setBigRadius(rs.getDouble("big_diameter"));
    lumberLog.setLumberType(rs.getLong("lumbertype"));
    lumberLog.setLumberClass(rs.getLong("lumberclass"));
    lumberLog.setCutPlanId(rs.getLong("planId"));
    LumberStack stack = new LumberStack();
    stack.setName(rs.getString("stackName"));
    stack.setId(rs.getLong("stack"));
    lumberLog.setStack(stack);
    IDPlate plate = new IDPlate();
    plate.setId(rs.getLong("idplate"));
    plate.setLabel(rs.getString("plateName"));
    lumberLog.setPlate(plate);
    lumberLog.setSupplierId(rs.getLong("SupplierId"));
    lumberLog.setTransportCertifiateId(rs.getLong("TransportCertificateId"));
    if (rs.wasNull()) {
      lumberLog.setTransportCertifiateId(null);
    }
    lumberLog.setMarginPercent(rs.getInt("Margin"));
    lumberLog.setMarginVolume(rs.getDouble("MarginVolume"));
    lumberLog.setMarginRealVolume(rs.getDouble("RealMarginVolume"));

    return lumberLog;
  }