-->
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: "<=" sign not working
PostPosted: Fri Jan 05, 2007 1:11 pm 
Newbie

Joined: Thu Oct 19, 2006 12:11 pm
Posts: 3
3.0:

I'm trying to use the "<=:" and ">=" signs in my following query.

<query name="findProduct">
from Inventory c where
c.companyCode = :companyCode and
c.productType=:productType and
c.Id = :Id and
c.cucDealer = :cucDealer and
c.creationTimeStamp >=:startCreationTimeStamp and
c.creationTimeStamp <=:endCreationTimeStamp
</query>



">=" works fine but for "<=" Hibernate gives me a DOM syntax exception. Following is a part of the stack trace.

org.dom4j.DocumentException: Error on line 86 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream


The syntax error disappears if I remove the "<=".

And I'm using hibernate with Spring.

Any ideas ??

Thanks in advance.

Vikas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 1:47 pm 
Newbie

Joined: Thu Oct 19, 2006 12:11 pm
Posts: 3
I still can't make the "<=" work. But my query works fine if I use "between". Like this:

<query name="findProduct">
from Inventory c where
c.companyCode = :companyCode and
c.productType=:productType and
c.Id = :Id and
c.cucDealer = :cucDealer and
c.creationTimeStamp between :startCreationTimeStamp and
:endCreationTimeStamp
</query>


Thanks,
Vikas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 2:01 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
you need to put your query inside a CDATA block:

Code:
<query name='something'>
    <![CDATA[
        (query goes here)
    ]]>
</query>

_________________
nathan


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.