-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: All HQL delete is preceded by a select?
PostPosted: Wed May 05, 2004 1:58 am 
Beginner
Beginner

Joined: Wed Jan 21, 2004 10:52 pm
Posts: 27
Location: Santa Cruz do Sul - RS - Brazil
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.

_________________
Do you still create DTO factories? Oh, no!
Try DTOptimzier now!
https://dtoptimizer.dev.java.net/


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 12:24 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 8:55 am 
Newbie

Joined: Tue Jun 08, 2004 3:51 am
Posts: 8
Emmanuel,

I did not see that in the hibernate documentation, may be it will be worth writing it in the docs.

BR


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 9:13 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
It's a simple fact of ORM. Your objects might have lifecycle behavior that has to be executed before they are deleted.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.