Another question related to this one.
sometimes I use direct connection using jdbc to retrieve a object for performance sake.
In the code above I have to set the association codOrg which is another POJO
I have the ID of Org, what should I do? create a bean, set the ID and associate with my cliente bean?
Code:
String query ="select COD_ORG, DAT_INCLUSAO, DSC_EMAIL, IND_SITUA_FORNEC, NOM_CLI, VLR_SLD_DEV, COD_CLI from SSC_cliente where cod_cli_ext=?";
try {
Connection conn = session.connection();
PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1,codClienteExt);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
cli = new Cliente();
cli.setCodOrg(?????);
}
} catch (Exception e) {
e.printStackTrace();
throw new DaoException();
}