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.  [ 1 post ] 
Author Message
 Post subject: NHibernate CreateSQLQuery Problem
PostPosted: Thu Oct 15, 2009 9:46 am 
Newbie

Joined: Thu Oct 15, 2009 9:30 am
Posts: 1
Hello

i need your help with a native SQL query. Because of a project migration, complex queries and less time I have to use native SQLand the createSQLQuery function. The problem is selecting same table.

So the following is a short excerpt of the query:

Code:
SELECT 
  AGD.DATUM,
  EGD.DATUM,
  AGD.GENERATED_ID,
  EGD.GENERATED_ID
FROM
  C_BUCHG01 AGD,                           
  C_BUCHG01 EGD
WHERE 
  AGD.B_ART = 'AGD'
AND
  AGD.CO_Nr = EGD.CO_Nr
AND
  AGD.U_Nr = EGD.U_Nr


If I try this with Oracle SQL Developer, it works fine, but with Hibernate I get strange results:

Oracle, something like:

Datum_1 Datum_2 ID_1 ID_2
12.10.07 14.10.08 5 6

NHibernate:
Datum_1 Datum_2 ID_1 ID_2
12.10.07 12.10.07 5 5

Hibernate always takes the data from the first table.

Hope you can help me


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

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.