I try to use HQL for delete my objects.
But I have a question:
When I execute
Code:
session.delete("FROM Sistema AS sistema WHERE sistema.id = 10");
I see that Hibernate create a query for selects this object before run my delete, as bellow:
Code:
02:37:35,796 INFO [STDOUT] Hibernate: select sistema0_.id as id, sistema0_.descricao as descricao, sistema0_.nome as nome, sistema0_.operadorInclusao as operador4_, sistema0_.data
HoraInclusao as dataHora5_, sistema0_.operadorAlteracao as operador6_, sistema0_.dataHoraAlteracao as dataHora7_, sistema0_.versaoRegistro as versaoRe8_ from Sistema sistema0_ wher
e (sistema0_.id=10 )
02:37:35,843 INFO [STDOUT] Hibernate: select perfis0_.id as id__, perfis0_.sistemaId as sistemaId__, perfis0_.id as id0_, perfis0_.descricao as descricao0_, perfis0_.nome as nome0
_, perfis0_.sistemaId as sistemaId0_, perfis0_.operadorInclusao as operador5_0_, perfis0_.dataHoraInclusao as dataHora6_0_, perfis0_.operadorAlteracao as operador7_0_, perfis0_.dat
aHoraAlteracao as dataHora8_0_, perfis0_.versaoRegistro as versaoRe9_0_ from Perfil perfis0_ where perfis0_.sistemaId=?
02:37:35,859 INFO [STDOUT] Hibernate: select integrante0_.integranteId as integran1___, integrante0_.perfilId as perfilId__ from integrantePerfil integrante0_ where integrante0_.p
erfilId=?
02:37:35,890 INFO [STDOUT] Hibernate: delete from Perfil where id=?
02:37:35,921 INFO [STDOUT] Hibernate: delete from Sistema where id=?
Well, does have other way where the object(s) does not are retrieved (or, at least, not "fulling" objects) ?
Thanks for all.