Pessoal,
Bom dia. Estou tentando identificar onde ocorre um erro no meu software.
Quando tento executar o seguinte remove:
if (funcao.equals("remove")) {
String id = request.getParameter("id");
int idint = Integer.parseInt(id.trim());
pesquisaDao = em.find(Pesquisa.class, idint);
em.remove(pesquisaDao);
System.err.println("Pesquisa: " + id);
try {
em.getTransaction().begin();
em.getTransaction().commit();
} catch (Exception e) {
System.err.println("Erro :" + e.getMessage());
}
Eu vejo o seguinte erro na console e o registro não é removido :
Pesquisa: 96 --> esse é o id do registro que quero remover.
[TopLink Warning]: 2008.09.30 09:56:09.853–UnitOfWork(22364723)–Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘t0.pesquisaidCollection_id’ in 'where clause’
Error Code: 1054
Call: SELECT <a href="http://t1.id">t1.id</a>, t1.num_filhos, t1.endereco, t1.nome, t1.bairro, t1.senha, t1.cidade, t1.sexo, t1.estado, t1.renda, t1.telefone, t1.compl, t1.email, t1.login, t1.estado_civil, t1.CEP, t1.grupo_usuario_id FROM Pesquisa_Usuario t0, Usuario t1 WHERE ((t0.pesquisaidCollection_id = ?) AND (<a href="http://t1.id">t1.id</a> = t0.usuarioidCollection_id))
bind => [96]
Query: ReadAllQuery(entidades.Usuario)
Erro :Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column ‘t0.pesquisaidCollection_id’ in 'where clause’
Error Code: 1054
Call: SELECT <a href="http://t1.id">t1.id</a>, t1.num_filhos, t1.endereco, t1.nome, t1.bairro, t1.senha, t1.cidade, t1.sexo, t1.estado, t1.renda, t1.telefone, t1.compl, t1.email, t1.login, t1.estado_civil, t1.CEP, t1.grupo_usuario_id FROM Pesquisa_Usuario t0, Usuario t1 WHERE ((t0.pesquisaidCollection_id = ?) AND (<a href="http://t1.id">t1.id</a> = t0.usuarioidCollection_id))
bind => [96]
Query: ReadAllQuery(entidades.Usuario)
A tabela Pesquisa_Usuario existe no banco, está sendo referenciada pela classe PesquisaUsuario.
Já pesquisei o código inteiro e não achei esse texto : t0.pesquisaidCollection_id mencionado no erro.
Obrigado pela atenção,