views:

35

answers:

1

Hello all,

I get a compile error from eclipse with this hibernate query. Below is the code and the picture of eclipse compile error

<sql-query name="endDateChecker">
<return-scalar column="PId" type="java.lang.Long"/>
            select
            pid as PId
            from
            info
            where
            end_date < trunc(sysdate)
 </sql-query>

http://i34.tinypic.com/rrtq36.png -> my compile error picture

What did I do wrong, how do I fix it ?

+4  A: 

It's the < trunc(sysdate) part. Specifically, < character causes an error. Either wrap your SQL query in CDATA section:

<![CDATA[select ... where end_date < trunc(sysdate) ]]>

or esape < with &lt;.

Anton Gogolev