-->
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.  [ 2 posts ] 
Author Message
 Post subject: Need to solve the operator Sql IN
PostPosted: Wed Nov 30, 2005 12:51 pm 
Newbie

Joined: Wed Nov 30, 2005 12:34 pm
Posts: 1
Hi, i'm new in Hibernate.
I have to execute two sentences in a transaction with Hibernate, but i don´t know how can i do it.

The sentence in Sql is:
1.-
delete from historico_accion
where idsesion in
(select idsesion from Historico_Sesion
where f_ultimo_click <= TO_DATE('29/10/2005 23:59:59', 'DD/MM/YYYY HH24:MI:SS'))
2.-
delete from Historico_Sesion
where f_ultimo_click <= TO_DATE('29/10/2005 23:59:59', 'DD/MM/YYYY

I don´t know how works the "in" operator with hibernate
Somebody can help me???

In Spanish:
Hola, tengo que ejecutar unas sentencias dentro de una transacción, y no se como hacerlo.
Las sentencias usando Sql son las que aparecen arriba.
Tengo dos objetos Historico_Sesion y historico_accion que funcionan bien con hibernate, pero no se como hacer para relacionarlos mediante el operador in.
Necesito ayuda!!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 4:27 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
in operator is similar sql , but it is better using exists (performance are better and exists problem when subquery return too much results)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.