Estou tentando deletar dados usando uma query, mas esta dando o seguinte erro:
Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: expecting CLOSE, found ‘null’ near line 1, column 111 [DELETE FROM disciplina WHERE a.codigoprof IN(select b.codigoprof from professor where b.codigocol = 122]
Meu codigo
public void excluir(int codigo){
ConexaoH.getEntityManager().getTransaction().begin();
Query query = ConexaoH.getEntityManager().createQuery("DELETE FROM disciplina WHERE a.codigoprof IN(select b.codigoprof from professor where b.codigocol = :codigocol").setParameter("codigocol", codigo);
ConexaoH.getEntityManager().getTransaction().commit();
}
Alguma ideia do que qui pode ser ou do que qui posso mudar em meu código?