Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359664 - Add support for ctrl+click navigation in JPQL content assist
Summary: Add support for ctrl+click navigation in JPQL content assist
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: 3.3 M3   Edit
Assignee: Pascal Filion CLA
QA Contact:
URL:
Whiteboard: EaseOfUse
Keywords: plan
Depends on:
Blocks:
 
Reported: 2011-10-02 10:51 EDT by arjan tijms CLA
Modified: 2013-01-10 08:57 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arjan tijms CLA 2011-10-02 10:51:56 EDT
Build Identifier: 20110218-0911

Dali currently supports JPQL completion in orm.xml files. It however does not support the well known Eclipse feature of using ctrl+click to navigate to the declaration of entities used in the query.

I would like to request support for ctrl+click navigation on an entity type in the FROM clause to Java the declaration of that type. E.g.

SELECT
    _person
FROM
    Person _person

ctrl+click on Person should open Person.java in an editor.

Additionally, for completeness ctrl+click on _person could scroll the editor to the position in the FROM clause where this identification variable is declared.

Reproducible: Always
Comment 1 Pascal Filion CLA 2012-10-13 10:09:58 EDT
Added support for hyperlink in JPQL Query text area (found in JPA Details view).

Note: If the entity or persistent attribute is declared in a JPA Mappings file, hyperlink is not available. It seems XML editor does not support it.

Example 1: SELECT e FROM Employee e WHERE e.name = 'JPQL'
Example 2: UPDATE Employee SET e.name = 'JPQL'
           WHERE (SELECT a FROM address a) IS NOT NULL
Example 3: SELECT e FROM org.test.Employee e
Example 4: SELECT new java.lang.String(e.name) FROM Employee e
Example 5: SELECT e FROM Employee e WHERE e IN (Employee, Address)
Example 6: SELECT e FROM Employee e
           WHERE e.access == javax.persistence.AccessType.FIELD

Support:

• Available for entity name and entity literal.
  Example 1: Employee
  Example 5: Employee and Address defined in IN()

• Available for fully qualified class name.
  Example 3: org.test.Employee (Note: This is supported by
             EclipseLink 2.4 and above)
  Example 4: java.lang.String
  Example 6: javax.persistence.AccessType

• Available for mapping.
   • Open Declaration: Open the editor and select the persistent attribute,
     which is either the attribute or the get method
   • Open Declared Type: Open the editor on the mapping type
  Example 2: name
  Example 2: address

• Available for enum constant.
  Example 6: FIELD
Comment 2 Pascal Filion CLA 2013-01-08 22:52:54 EST
Example 2 should be using either qualified path expressions or unqualified path expressions, so it's either:

UPDATE Employee e SET e.name = 'JPQL'
WHERE (SELECT a FROM address a) IS NOT NULL

or

UPDATE Employee SET name = 'JPQL'
WHERE (SELECT a FROM address a) IS NOT NULL

I checked in the fix for properly supporting an unqualified path expression.
Comment 3 Pascal Filion CLA 2013-01-10 08:57:24 EST
EclipseLink bug 397858 takes care of fixing issues related to validating the path expression of an update item when the entity is not aliased with an identification variable.