-->
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.  [ 9 posts ] 
Author Message
 Post subject: OrderBy in Criteria
PostPosted: Thu Mar 18, 2004 4:06 am 
Newbie

Joined: Thu Mar 18, 2004 3:56 am
Posts: 13
Hi!
I'm new to this forum, however, i've studied Hibernate and i've made some test to look on how it work.
I've noticed that the Order by, in criteria doesn't work for aliases mapping (also if the normal expression works, with the same alias).
So, I've looked at the sources, and i've noticed that, in the class CriteriaLoader, during the translation of orderBy string, the class do not pass the aliasMap to the method that translate the string (and this method, pass an empty aliasMap to the same metod used by expression to translate to SQL string).
There is a why, this is doned so?
There is a problem if i modify the sources, to make the method pass the aliasMap? (i've tryed it, and seem that it work good).

Thanks for the answer!

Greetings!

Luka.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 18, 2004 4:08 am 
Newbie

Joined: Thu Mar 18, 2004 3:56 am
Posts: 13
Sorry, i've forgot to say that i use the version 2.1.2 of Hibernate with an Oracle database.

BYE!


Top
 Profile  
 
 Post subject: OrderBy in Criteria
PostPosted: Sun May 02, 2004 2:20 pm 
Newbie

Joined: Sun May 02, 2004 12:02 pm
Posts: 4
Location: Belgie
This is my first day with hibernate.
I think I have the same problem.
Following the "first use" trail, I'm trying to build the eg demo on pointbase
4.8RE with hibernate 2.1.3.
I get errors on order_by:

[java] Hibernate: select auctionite0_.id as x0_0_, auctionite0_.description
as x1_0_, auctionite0_.ends as x2_0_, max(bids1_.amount) as x3_0_ from AuctionI
tem auctionite0_ left outer join Bid bids1_ on auctionite0_.id=bids1_.item group
by auctionite0_.id , auctionite0_.description , auctionite0_.ends order by au
ctionite0_.ends desc

select has:auctionite0_.ends as x2_0_
order by uses the wrong name (auctionite0_.ends), if i edit the query and replace it with order by x2_0_
everything is OK.

Bug?
How do I solve this?

-----------------------------------------------------------------------------------
Small unrelated editorial remark, the readme.txt says:

Quote:
Instructions
------------
Unzip to installation directory.

See index.html in the doc directory.

There is no such file in the doc directory.

thanks in advance for the help,

Jan

_________________
I've got plenty of Java and Chesterfield Kings
The nightfly - Donald Fagen


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 02, 2004 10:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use a more up-to-date version of your database which does not have this bug.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 03, 2004 2:24 am 
Newbie

Joined: Sun May 02, 2004 12:02 pm
Posts: 4
Location: Belgie
The pointbase I'm using is the one bundled with the latest J2EE SDK
(22 march 2004).
The pointbase site is very unaccessible but judging from the press releases
4.8 is the latest and recommended version.

thanks,

jan.

_________________
I've got plenty of Java and Chesterfield Kings
The nightfly - Donald Fagen


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 03, 2004 5:54 am 
Newbie

Joined: Thu Mar 18, 2004 3:56 am
Posts: 13
I must say that my post is referenced to the Criteria class :).

Using the HQL all work good ^^.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 03, 2004 6:03 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Report this as a bug in pointbase.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 03, 2004 6:09 am 
Newbie

Joined: Thu Mar 18, 2004 3:56 am
Posts: 13
gavin wrote:
Report this as a bug in pointbase.

I've altready posted the solution in the jira issue :).
(and some other people have posted other solutions too).

The Link of the Jira issue is:
http://opensource.atlassian.com/project ... wse/HB-132

BYE!


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 03, 2004 1:15 pm 
Newbie

Joined: Sun May 02, 2004 12:02 pm
Posts: 4
Location: Belgie
thanks guys,
I corrected the bug in pointbase
(it's called mysql now)

jan

_________________
I've got plenty of Java and Chesterfield Kings
The nightfly - Donald Fagen


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