}
public PreparedStatement prepareStatement(ResultSet rs,
PreparedStatement statement, List<String> messages)
throws Exception {
Visita v = (Visita) getObject(rs);
statement.setLong(1, v.getId());
statement.setDate(2, new java.sql.Date(v.getTimestamp().getTime()));
statement.setString(3, v.getObservacao());
statement.setDate(4, new java.sql.Date(v.getDataInicio().getTime()));
if (v.getDataFim() == null) {
statement.setNull(5, Types.NULL);
} else {
statement.setDate(5, new java.sql.Date(v.getDataFim().getTime()));
}
statement.setBoolean(6, v.getMotivo().getCurso());
statement.setBoolean(7, v.getMotivo().getChat());
statement.setBoolean(8, v.getMotivo().getEmail());
statement.setBoolean(9, v.getMotivo().getEscolar());
statement.setBoolean(10, v.getMotivo().getJogo());
statement.setBoolean(11, v.getMotivo().getOficina());
statement.setBoolean(12, v.getMotivo().getOutro());
statement.setBoolean(13, v.getMotivo().getWeb());
statement.setNull(14, Types.NULL);
if (!(v.getEquipamento() == null)) {
statement.setLong(17, v.getEquipamento().getId());
} else {
statement.setNull(17, Types.NULL);
}
if (!(v.getTelecentro() == null)) {
statement.setLong(15, v.getTelecentro().getId());
} else {
statement.setNull(15, Types.NULL);
messages.add("Registro de VISITA (id: " + v.getId()
+ ") com chave estrangeira de Telecentro = NULL");
}
if (!(v.getUsuario() == null)) {
statement.setLong(16, v.getUsuario().getId());
} else {
statement.setNull(16, Types.NULL);
messages.add("Registro de VISITA (id: " + v.getId()
+ ") com chave estrangeira de Usuario = NULL");
}
return statement;
}