-->
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.  [ 6 posts ] 
Author Message
 Post subject: same query different result ???
PostPosted: Sat Aug 21, 2004 10:11 pm 
Newbie

Joined: Fri Aug 20, 2004 9:07 pm
Posts: 5
Location: antofagasta-chile
Hibernate version: 2.1


Name and version of the database you are using: Oracle 8i


CODE HIBERNATE HSQL
List _list_ = session.createQuery(" select cout(*) " +
"from AuditServicio as a " +
"where a.Id = 1146 "+
"group by a.id,a.idServicio " +
"order by count(*)").list();

SQL*PLUS

select count(*)
from Audit_servicio
where id =1146
group by id, id_servicio
order by count(*)

Results Hibernate
1
1
1
.....
1
1

Results SQL*PLUS
COUNT(*)
----------
1
1
2
2
3
6
6
6
9
14
15

COUNT(*)
----------
29
61
77
108
134


i can't understand, could help me, please


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 21, 2004 10:33 pm 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
Hibernate 2.1.? What is the minor version number? Not that it will make that much of a difference, but everything helps.

Can you confirm that it is using the same SQL? Within your configuration, set the show_sql property to true and compare the actual SQL that is generated with what you are using in SQL*PLUS.

_________________
Matt Veitas


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 22, 2004 12:27 am 
Newbie

Joined: Mon Aug 09, 2004 4:28 am
Posts: 18
Location: Australia
Is your problem from a type ????

In your Hibernate SQL you have :

List _list_ = session.createQuery(" select cout(*) " +
"from AuditServicio as a " +
"where a.Id = 1146 "+
"group by a.id,a.idServicio " +
"order by count(*)").list();


Should it have been "select count" and not "select cout" ????

Obviously this could have just been a typo in your documentation of the problem and nothing to do with the problem .....

Mike.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 22, 2004 9:43 am 
Newbie

Joined: Fri Aug 20, 2004 9:07 pm
Posts: 5
Location: antofagasta-chile
thanks so much, watching the query with sql_query true
tell me which the table where are doing the query was other


please realy sorry my languages ^_^U


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 22, 2004 11:48 am 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
What was the actual SQL that Hibernate was generating? Inquiring minds want to know!

_________________
Matt Veitas


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 22, 2004 2:07 pm 
Newbie

Joined: Fri Aug 20, 2004 9:07 pm
Posts: 5
Location: antofagasta-chile
Don't blame Hibernate. 99% of posts titled "bug in Hibernate" are simple user error

it's a simple user error, i'm wrong with table in the map file,
in the sql*plus i'm using the Audit_servicio but the hibernate map file "AuditServicio.hbm.xml" i'm using audit_user_servicio.

excuse me by the annoyance.


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