Pessoal,
Eu tenho esse método que faz um select e retorna uma Collection:
public Collection<TbrcpRegraCondicaoPagtoPz> SelectUpgradeCondicaoDePagamento() throws SQLException{
PreparedStatement stmt =
this.connection.prepareStatement("select rcp_id cod_cond_pagto,"
+ "rcp_descricao nom_cond_pagto"
+ "from TBRCP_REGRA_CONDICAO_PAGTO_PZ"
+ "order by rcp_descricao");
ResultSet rs = stmt.executeQuery();
List<TbrcpRegraCondicaoPagtoPz> contatos = new ArrayList<TbrcpRegraCondicaoPagtoPz>();
while(rs.next()){
TbrcpRegraCondicaoPagtoPz retorno = new TbrcpRegraCondicaoPagtoPz();
retorno.setRcpId(rs.getInt("cod_cond_pagto"));
retorno.setRcpDescricao(rs.getString("nom_cond_pagto"));
contatos.add(retorno);
}
rs.close();
stmt.close();
return contatos;
}
Mas e quando eu quero fazer um select em mais de uma tabela? eu tenho q unir os beans em um só?