Java Mailing List Archive

http://www.java2.5341.com/

Home » user-java.ibatis »

can IBATIS handle mysql "DATE" keyword?

jrhitokiri

2009-10-14

Replies: Find Java Web Hosting

Author LoginPost Reply

I have this query I tested in mysql. it works when I type it and use example
input:

CODE:
select * from eservations where
(DATE(start) < DATE(input_start) AND
DATE(input_start) < DATE(END))

OR

(DATE(start) < DATE(input_end) AND
DATE(input_end) < DATE(end))

the thing is, ibatis throws an exception when I add it to my xml file:

CODE:
<select id="getPossibleConflicts"
parameterClass="iReserveClasses.Reservations"
resultClass="iReserveClasses.Reservations">
 select * from reservations where ((DATE(start) < DATE(#start#)) AND
(DATE(#start#) < DATE(end))) OR ((DATE(start) < DATE(#end#)) AND
(DATE(#end#) < DATE(end)))
</select>

Now I know it's this particular query that does not work, because when I
take it out, no exceptions are thrown. Is there something wrong with this
query? Or can Ibatis use the "Date" keyword?

ERROR SNAPSHOT:
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
org.xml.sax.SAXParseException: The content of elements must consist of
well-formed character data or markup.
  at
com.ibatis.common.xml.NodeletParser.processNodelet (NodeletParser.java:123)
...

Please, I need your help with this. Thanks.

kind regards
JR
--
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@(protected)
For additional commands, e-mail: user-java-help@(protected)

©2008 java2.5341.com - Jax Systems, LLC, U.S.A.