2 Replies Latest reply on Jul 3, 2003 1:40 PM by kbutler

    EJBQL Compile error...bug?

    kbutler Newbie

      Hi -
      I recall seeing a forum post about the Schema name in a CMP EJBQL statement being limited to 15 characters in 3.2.1, due to a bug. Anybody know if this is true?

      Here's my error:

      org.jboss.deployment.DeploymentException: Error compiling JBossQL statement 'SELECT OBJECT(b) FROM TBBUILDERPROVIDERASSOC b WHERE b.BUILDERID = ?1 AND b.SECTIONTYPEID = ?2'; - nest
      ed throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "TBBUILDERPROVI
      DERASSOC" at line 1, column 23.
      Was expecting one of:
      "IN" ...
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCJBossQLQuery.(JDBCJBossQLQuery.java:46

      I verified that the types match, the names are OK...

      The query looks like my other queries, which deploy fine. I'm a bit flummuxed.

      Thanks for any insights -

        • 1. Re: EJBQL Compile error...bug?
          kbutler Newbie

          I changed the name of my schema and got the same error. Also I could not find the original post I had seen; and I didn't find anything relevent on SourceForge bug db.

          I did see a note from Dain S. in the bug db about case-sensitivity - he said that keywords and identification variables are case-insensitive - everything else is sensitive. I have to check the spec to see exactly what he means by the latter.

          Here's my query DD as generated by XDoclet:

          <jboss-ql><![CDATA[SELECT OBJECT(b) FROM TBB b WHERE b.BuilderID = ?1 AND b.SectionTypeID = ?2]]></jboss-ql>

          • 2. Re: EJBQL Compile error...bug?
            kbutler Newbie

            OK...NEWBIE ERROR!! We knew that already.

            Here's the deal, this may help somebody:

            I did not truly understand/believe that the EJB-QL really relates purely to the abstract schema (defined in the bean DeploymentDescriptor). Duh. Of course, this is the whole idea (allow the container to map to physical representation).

            Which means that every token referenced in the EJBQL query, MUST relate to a token defined in the **abstract** schema, not the real schema.

            Here is the corrected query:

            SELECT OBJECT(b) FROM BuilderProviderAssoc b WHERE b.builderID = ?1 AND b.sectionTypeID = ?2

            And from the DD:

            <cmp-field >
            <![CDATA[Return BuilderID]]>
            <cmp-field >
            <![CDATA[Return SectionTypeID]]>

            "Of course...the files are IN the computer....it's so simple..." -Zoolander