-->
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.  [ 5 posts ] 
Author Message
 Post subject: Ordering Problems
PostPosted: Mon Jan 28, 2008 11:36 am 
Beginner
Beginner

Joined: Fri Dec 23, 2005 6:05 am
Posts: 42
Hi,

I am trying to do a simple query.
Code:
select a from A a where a.prop1 = 1 order by a.prop2.propofprop

Please keep in mind that "prop2" may be NULL.
Using that expression returns zero results. Wihout the order argument, everything works fine (beside that the results aren't ordered *g*).

Any suggestions?

Thanks in advance

eg


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 28, 2008 1:10 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Utiliza "left joins" entre A y prop1, y entre prop1 y prop2, para asegurarte de que la cosa funcione incluso si hay valores nulos.

_________________
Gonzalo Díaz


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 3:50 am 
Beginner
Beginner

Joined: Fri Dec 23, 2005 6:05 am
Posts: 42
gonzao_diaz wrote:
Utiliza "left joins" entre A y prop1, y entre prop1 y prop2, para asegurarte de que la cosa funcione incluso si hay valores nulos.

Gracias,

Andonde esperas que use left join. Yo uso
Code:
<many-to-one name="prop2" class="propDomain, prop2Class" cascade="save-update" unique="true" />


No estoy seguro adonde utilizarlo.

Gracias

eg

In english :
Where should I use left join. My tag looks like
Code:
<many-to-one name="prop2" class="propDomain, prop2Class" cascade="save-update" unique="true" />


I am not shure where to put it in.

Thanks

eg


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 2:09 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
En el código HQL.

_________________
Gonzalo Díaz


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 29, 2008 2:17 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
En el código HQL (o el Criteria, si utilizaste uno de ésos).
En los archivos de mapeo se indica que hay un "join", pero no de qué tipo.

_________________
Gonzalo Díaz


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