Velocity parsing error with "##"

From: Laurent Marchal (lmarcha..maeur.eu)
Date: Thu Aug 12 2010 - 22:27:58 UTC

  • Next message: Evgeny Ryabitskiy: "Re: Velocity parsing error with "##""

      Hi all,

         After months of using Cayenne 3.0 (which is awesome BTW) I just
    discovered that when I put two "##" in some of my object names in
    database and then I use some SQLTemplate I have a Velocity error. It
    seems that Velocity does not like ## because it's detected as a bad
    directive. I looked in the Velocity documentation but to me it's
    supposed to ignore single quoted string literals.
    <http://velocity.apache.org/engine/releases/velocity-1.6.4/user-guide.html#stringliterals>

    Caused by: org.apache.cayenne.CayenneRuntimeException: [v.3.0 Apr 26
    2010 09:59:17] Error parsing template 'SELECT COUNT(JOBNAME) AS RESULT
    FROM JMASTER WHERE SKDID = 67 AND UPPER(JOBNAME) = 'TEST##'' : Lexical
    error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error
    at line 1, column 92. Encountered: <EOF> after : ""
         at
    org.apache.cayenne.access.jdbc.SQLTemplateProcessor.buildStatement(SQLTemplateProcessor.java:149)
         at
    org.apache.cayenne.access.jdbc.SQLTemplateProcessor.processTemplate(SQLTemplateProcessor.java:122)
         at
    org.apache.cayenne.access.jdbc.SQLTemplateAction.performAction(SQLTemplateAction.java:125)
         at
    org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:87)
         at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:269)

    Do you have any advices to make Velocity ignore parsing these names ?

    Thanks.



    This archive was generated by hypermail 2.0.0 : Fri Aug 13 2010 - 07:05:56 UTC