-->
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.  [ 1 post ] 
Author Message
 Post subject: HQL bug with array?
PostPosted: Mon Feb 11, 2008 6:41 am 
Beginner
Beginner

Joined: Thu Jun 07, 2007 2:38 am
Posts: 28
Location: Italy, Rome
Considering this piece of HQL:

Code:
select resource FROM Resource resource WHERE  title like '%near%' or keywords[0] like '%near%'


My mapping looks like this.
Code:
@CollectionOfElements(targetElement = String.class)
@IndexColumn(name = "keywordIndex")
String[] keywords;


The where clause does contain 2 OR statements.

(1) When I include the second OR statement, the result list contains 0 elements.
(2)When I leave the second OR statement, the result list contains 1 elements.

From a boolean algebra point of view, the OR statement does not work correctly. In both situations, (1) and (2), the result list should contain 1 element.

Am I right that this is an HQL implementation bug, or am I missing something?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.