-->
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: filter condition problem
PostPosted: Thu Apr 16, 2009 5:58 am 
Newbie

Joined: Thu Jan 24, 2008 4:03 am
Posts: 2
Hi,

I try to put a filter in my hbm.xml file but I have a problem with my condition.

Here is my condition :

Code:
<filter name="effectiveTimeInstantFilter" condition="START_DATE <= :effectiveDate AND (END_DATE IS NULL OR END_DATE >= :effectiveDate)"/>


Off course the condition is bad writen but I don't know how to correctly write this condition.

Can anyone help me?

Thank you!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 16, 2009 7:24 am 
Regular
Regular

Joined: Thu Sep 06, 2007 2:22 am
Posts: 108
Location: Noida,India
I think, problem is due to you are using same name parameter two time.

Use different name for both name parameter, but you can pass same value to both parameter when setting value for name parameter.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 16, 2009 8:01 am 
Newbie

Joined: Thu Jan 24, 2008 4:03 am
Posts: 2
I finally found the solution.

I use CDATA tag :
Code:
<filter name="effectiveTimeInstantFilter">
            <![CDATA[
            START_DATE <= :effectiveDate AND (END_DATE IS NULL OR END_DATE >= :effectiveDate)
            ]]>           
             </filter>


It works perfectly.

Thank you for the quick reply.


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.