-->
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.  [ 3 posts ] 
Author Message
 Post subject: Help - How can i get show "" when the property=nul
PostPosted: Mon Mar 20, 2006 4:21 pm 
Regular
Regular

Joined: Wed Feb 22, 2006 11:28 am
Posts: 65
Location: Santiago, Chile
Hello Every Body:

I wrote a HQL Query, like this:
[b]select order.name, order.status.name from order[/b]

In order to the bussiness logic, a order may have no status, so the status name have to be null or "".

When i execute the query, the hibernate got show all "orders" that have status values, but no tha orders which have no status.

¿How can I do to reemplaze the null value of propery status in the object Order?

status (id, name)
id name
===========
1 Sended
2 Reserved

order(id, name, idStatus)
id name idStatus
==================
1 o1
2 o2 2

The response ideal:

o1, "" (spaces)
o2, Reserverd.

Can some one help me?

Thank for your help.

Regards. Neketsu Shonen


Top
 Profile  
 
 Post subject: ?
PostPosted: Mon Mar 20, 2006 6:24 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Something like this
Select o.name , s.name
from Order o left outer join o.status s

http://www.hibernate.org/hib_docs/v3/re ... yhql-joins

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: Re: ?
PostPosted: Tue Mar 21, 2006 9:58 am 
Regular
Regular

Joined: Wed Feb 22, 2006 11:28 am
Posts: 65
Location: Santiago, Chile
Hello Friend:

Thank for your help. Thats helpme a lot.

Thanks.


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