-->
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: in (:orderList) + empty orderList: unexpected end of subtree
PostPosted: Mon Apr 03, 2006 7:19 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
I am using a query which has a parameter of orderList and uses it like:
select orderLine from OrderLine orderLine
where orderLine.order in (:orderList)

The orderList is the result of a comlicated algoritm using other queries.
Sometimes this orderList is empty, in which case I would except that there aren't any orderLines which are in the given orderList.
Instead, Hibernate throws an exception: "unexpected end of subtree",
because the list is empty.
Is this the way it was intended? Should I escape specifically an emtpy orderList?

Using hibernate 3.1.1 with hibernate annotations beta8.

_________________
http://www.ohloh.net/accounts/ge0ffrey


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 03, 2006 1:03 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
you should escape it to avoid an unnecessary DB roundtrip.
Actually some DB do not support .. in () <- empty element

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 04, 2006 5:24 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
HSQLDB doesn't support it.
I 'll escape it, thanks for the info.

_________________
http://www.ohloh.net/accounts/ge0ffrey


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.