Community
Participate
Working Groups
Steps to reproduce: 1a. Have a project with at least one JPA entity or 1b. Create new JPA project and a new JPA entity 2. Create a JPA ORM Mapping File 3. Add the JPA entity to the ORM 4. Add the following line between <entity> and </entity> <named-query name="q"><query>select</query></named-query> 5. Position the cursor before the identifier select and invoke the content assist, three possible choices are displayed in the content assist popup (select, update, delete from) 6. Now change the query to be <![CDATA[select e from ]]> 7. No proposals are available at any position within the query. Problem: The offset starts at the beginning of the CDATA section but not at the beginning of the query.
Where did you run across this use case?
Fix checked into trunk. The fix involves the following. - Works with and without a CDATA section. - Works with the JPQL query starting on the next line, content assist will not remove CDATA tags or the leading whitespace. - Added support for all HTML pre-defined escape characters, example: < or < which represents <. API changes: - XmlQuery - Added 3 methods (getActualQuery(), getQueryOffset(), isQueryInsideCDATASection()) to help fix alignment issue of content assist and validation text range. - JpaJpqlQueryHelper - Changed the signature of validate() to better support content assist and validation in split strings in a Java annotation and various layout of the query in XML Example 1: <query>select abs(e) from employee e where e.name = 2</query> Example 2: <query> select abs(e) from employee e where e.name = 2 </query> Example 3: <query><![CDATA[select abs(e) from employee e where e.name = 2]]></query> Example 4: <query><![CDATA[ select abs(e) from employee e where e.name = 2]]> </query> Example 5: <query>select e from Employee e where e.name <> 'JPQL'</query> The query is "select e from Employee e where e.name <> 'JPQL'"