-->
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: FROM SQL TO HQL
PostPosted: Mon Apr 28, 2008 6:16 am 
Newbie

Joined: Mon Apr 28, 2008 6:02 am
Posts: 3
Salut a tout le monde j'ai un petit probleme avec un code hql je voudrais asvoir comment faire pour "convertir" une requette msql en hql
Code:

SELECT
   ID ID_JOB,
   SEQ ID,
   (SELECT DISTINCT VALUE JOB_GROUP FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'JOB_GROUP') JOB_GROUP,
   (SELECT DISTINCT VALUE JOB_NAME FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'JOB_NAME') JOB_NAME, 
   AGENT HOST,
   TIME START_DATE,
   (SELECT DISTINCT VALUE RETRY FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'RETRY') RETRY,
   TYPE,
   TYPE_DESCRIPTION,
   ERR ERROR,
   ERROR_DESCRIPTION,
   (SELECT DISTINCT VALUE MESSAGE FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'MESSAGE') MESSAGE

   FROM
   (SELECT DISTINCT A.ID, A.SEQ, A.POS, A.AGENT, A.TIME, A.TYPE, T.DESCRIPTION TYPE_DESCRIPTION, ERR,
   E.DESCRIPTION ERROR_DESCRIPTION FROM DC_LOGGING A, DC_LOG_TYPE T, DC_ERRORS E
   WHERE A.ID = 66656 AND A.POS = 'T' AND A.TYPE = T.ID_LOG_TYPE AND A.ERR = E.ID) AA ORDER BY SEQ


le probleme se pose au niveau du
Code:
....
FROM
   (SELECT DISTINCT A.ID, A.SEQ, A.POS, A.AGENT, A.TIME, A.TYPE, T.DESCRIPTION TYPE_DESCRIPTION, ERR,
   E.DESCRIPTION ERROR_DESCRIPTION FROM DC_LOGGING A, DC_LOG_TYPE T, DC_ERRORS E
   WHERE A.ID = 66656 AND A.POS = 'T' AND A.TYPE = T.ID_LOG_TYPE AND A.ERR = E.ID) AA ORDER BY SEQ

je sais pas comment interpreter " select from(selec...) merci d'avance de votre aide


Top
 Profile  
 
 Post subject: Re: FROM SQL TO HQL
PostPosted: Thu Jul 23, 2009 8:45 am 
Newbie

Joined: Thu Jul 23, 2009 8:33 am
Posts: 1
Bonjoour,
moi aussi j'ai le meme probleme j'arrive pas a ecrire une telle requete en HQL, est ce que vous etes arrivé a la faire ?

Merci d'avance.


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.