-->
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: Possible error in parsing JPA named query
PostPosted: Wed Jan 25, 2012 7:32 am 
Newbie

Joined: Wed Jan 25, 2012 7:04 am
Posts: 1
Hi

We use JBoss 6.1 and I think, Hibernate Core 3.6.6.Final. I made a little mistake by defining a named query. The following query passed the query validation:

Code:
<named-query name="Trade.getAllOmpReversalFromToday">
   <query>SELECT t FROM Trade t
               WHERE t.reversal.reversalType IN ('Mistrade', 'OnBehalf') )  <-- bracket to much
               AND (DATE(t.buy.transactionTime) = CURRENT_DATE() OR DATE(t.sell.transactionTime) = CURRENT_DATE())</query>
</named-query>


The side effect is that the query strips out the date comparision and returns everything which is passes the 'IN ('Mistrade,''ObBehalf')' clause. I would expect that Hibernate throws an error saying that the named query has an error.

I am not sure, is that something you want to know or you have already fixed.

Regards,
Ralf


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.