Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 216643 - JPA Autocomplete fails when NamedQuery name is not a literal
JPA Autocomplete fails when NamedQuery name is not a literal
Status: RESOLVED FIXED
Product: javaee
Classification: Unclassified
Component: Persistence
7.2
All All
: P3 (vote)
: 7.3
Assigned To: Sergey Petrov
issues@javaee
: USABILITY
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-10 08:10 UTC by atr_23
Modified: 2012-09-20 02:25 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description atr_23 2012-08-10 08:10:32 UTC
It would be nice if all of the following variants would be supported. Allowing expressions in the query would be great too. Also see http://netbeans.org/bugzilla/show_bug.cgi?id=212951

@NamedQueries({
    //jpql completion
    @NamedQuery(name = "MyEntity.findByName0", query = "SELECT me FROM MyEntity me WHERE me.name=:name"),
    //no jpql completion
    @NamedQuery(name = MyEntity.ENTITY_NAME + ".findByName1", query = "SELECT me FROM MyEntity me WHERE me.name=:name"),
    @NamedQuery(name = MyEntity.QUERY, query = "SELECT me FROM MyEntity me WHERE me.name=:name")
})
@Entity(name = MyEntity.ENTITY_NAME)
public class MyEntity implements Serializable {

    public static final String ENTITY_NAME = "MyEntity";
    /**
     * Parameters: name ({@link String})
     */
    public static final String QUERY = ENTITY_NAME + ".findByName2";
Comment 1 Sergey Petrov 2012-08-10 10:36:05 UTC
autocompletion may be easy to enable, but need to check also navigation to queries with names build from literals, may be it will not work and may not be supported first.
Comment 2 Sergey Petrov 2012-09-18 11:50:45 UTC
have small fшx to cover simple identifier, but ше will not work for complex(summ etc.) case
Comment 3 Quality Engineering 2012-09-19 03:03:56 UTC
Integrated into 'main-golden', will be available in build *201209190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8588898f93ec
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216643 fix parser
Comment 4 Sergey Petrov 2012-09-19 12:07:17 UTC
http://hg.netbeans.org/web-main/rev/268befa2f555 should be fixed for mentioned case, but there are some other issues I'm going to fix as separate case
Comment 5 Quality Engineering 2012-09-20 02:25:51 UTC
Integrated into 'main-golden', will be available in build *201209200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/268befa2f555
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #216643 enhance logic to support more combinations in attribute value


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo