Favor alguem pode me ajuda com esse update em varias tabelas
public void alterarPessoaHb(Pessoa pessoa) throws DAOException {
Session sessions = HbLocator.currentSession();
Transaction tx = sessions.beginTransaction();
try {
Query query = sessions.createQuery(
" UPDATE Pessoa p " +
" ,Endereco e " +
" ,CadastroPessoa cp " +
" ,ImpostosReter ir " +
" SET p.tipoPessoa = ? " +
" , p.codAlternativo = ? " +
" , p.nomeCompleto = ? " +
" , p.nomeRazao = ? " +
" , p.nomeFantasia = ? " +
" , p.sexo = ? " +
" , p.dataNasc = ? " +
" , p.rg = ? " +
" , p.cpf = ? " +
" , p.cnpj = ? " +
" , p.inscrEstadual = ? " +
" , p.inscrMunicipal = ? " +
" , e.logradouro = ? " +
" , e.numero = ? " +
" , e.bairro = ? " +
" , e.cidade = ? " +
" , e.estado = ? " +
" , e.cep = ? " +
" , e.email = ? " +
" , cp.cadPor = ? " +
" , cp.cadData = ? " +
" , cp.cadAltPor = ? " +
" , cp.cadAltData = ? " +
" , ir.inss = ? " +
" , ir.iss = ? " +
" , ir.irrf = ? " +
" , ir.irrj = ? " +
" , ir.cofins = ? " +
" , ir.ipi = ? " +
" , ir.pis = ? " +
" , ir.csll = ? " +
" WHERE p.codReduzido = ? " +
" AND e.id = e.endereco_ID " +
" AND cp.id = cp.cadastroPessoa_ID " +
" AND ir.id = ir.impostosReter_ID ")
.setString(0, pessoa.getTipoPessoa())
.setString(1, pessoa.getCodAlternativo())
.setString(2, pessoa.getNomeCompleto())
.setString(3, pessoa.getNomeRazao())
.setString(4, pessoa.getNomeFantasia())
.setString(5, pessoa.getSexo())
.setDate(6, pessoa.getDataNasc())
.setString(7, pessoa.getRg())
.setString(8, pessoa.getCpf())
.setString(9, pessoa.getCnpj())
.setString(10, pessoa.getInscrEstadual())
.setString(11, pessoa.getInscrMunicipal())
.setString(12, pessoa.getEndereco().getLogradouro())
.setString(13, pessoa.getEndereco().getNumero())
.setString(14, pessoa.getEndereco().getBairro())
.setString(15, pessoa.getEndereco().getCidade())
.setString(16, pessoa.getEndereco().getEstado())
.setString(17, pessoa.getEndereco().getCep())
.setString(18, pessoa.getEndereco().getEmail())
.setString(19, pessoa.getCadastroPessoa().getCadPor())
.setDate(20, pessoa.getCadastroPessoa().getCadData())
.setString(21, pessoa.getCadastroPessoa().getCadAltPor())
.setDate(22, pessoa.getCadastroPessoa().getCadAltData())
.setDouble(23, pessoa.getImpostosReter().getInss())
.setDouble(24, pessoa.getImpostosReter().getIss())
.setDouble(25, pessoa.getImpostosReter().getIrpf())
.setDouble(26, pessoa.getImpostosReter().getIrpj())
.setDouble(27, pessoa.getImpostosReter().getCofins())
.setDouble(28, pessoa.getImpostosReter().getIpi())
.setDouble(29, pessoa.getImpostosReter().getPis())
.setDouble(30, pessoa.getImpostosReter().getCsll())
.setString(31, pessoa.getCodReduzido());
query.executeUpdate();
tx.commit();
} catch (Exception e) {
e.printStackTrace();
tx.rollback();
throw new DAOException("[PessoaDAOImpl - updatePessoaHb] " + e.getMessage(), e);
}
HbLocator.closeSession();
}
line 1:46: expecting "set", found ','
16:54:18,359 ERROR [STDERR] org.hibernate.hql.ast.QuerySyntaxException: expecting "set", found ',' near line 1, column 46 [ UPDATE br.com.locadeveloper.model.Pessoa p , br.com.locadeveloper.model.Endereco e , br.com.locadeveloper.model.CadastroPessoa cp , br.com.locadeveloper.model.ImpostosReter ir SET p.codAlternativo = ? , p.nomeCompleto = ? , p.nomeRazao = ? , p.nomeFantasia = ? , p.sexo = ? , p.dataNasc = ? , p.rg = ? , p.cpf = ? , p.cnpj = ? , p.inscrEstadual = ? , p.inscrMunicipal = ? , e.logradouro = ? , e.numero = ? , e.bairro = ? , e.cidade = ? , e.estado = ? , e.cep = ? , e.email = ? , cp.cadPor = ? , cp.cadData = ? , cp.cadAltPor = ? , cp.cadAltData = ? , ir.inss = ? , ir.iss = ? , ir.irrf = ? , ir.irrj = ? , ir.cofins = ? , ir.ipi = ? , ir.pis = ? , ir.csll = ? WHERE p.codReduzido = ? AND e.id = e.endereco_ID AND cp.id = cp.cadastroPessoa_ID AND ir.id = ir.impostosReter_ID ]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
sem mais. ja agradeço !
valeu!