This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 203333 - @NamedNativeQuery copied twice.
Summary: @NamedNativeQuery copied twice.
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.1
Hardware: PC Windows Vista
: P2 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 203341 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-07 23:44 UTC by bht
Modified: 2012-10-26 01:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Testcase in zip file (15.34 KB, application/octet-stream)
2011-10-07 23:44 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2011-10-07 23:44:24 UTC
Created attachment 111683 [details]
Testcase in zip file

Version 7.1 beta

To reproduce, please use the attached project, or follow these steps:

How to reproduce:

- Menu|File|New Project|JavaEE|EJB Module|Next|Finish
- Projects Window|Project|Source Packages|New|Java Package|entity
- Projects Window|Project|Source Packages|New|Java Package|entity|New|Entity Class|MyEntity|Next|Data Source: jdbc/sample|Finish
- In MyEntity.java. add:

    public static final String GET_BY_NAME = "MyEntity.getByMemberId";
    public static final String DELETE_BY_ID = "TripOfferShortlist.deleteById";
    public static final String INSERT_NATIVE = "MyEntity.insert";
    private String name;
	
	and generate getter/setter

- In MyEntity.java, below @Entity, add:
@NamedQueries(value = {
    @NamedQuery(name = MyEntity.GET_BY_NAME, query = "select s.id from MyEntity s where s.name= :name")
    , @NamedQuery(name = MyEntity.DELETE_BY_ID, query = "delete from MyEntity s where s.id= :id= :id")
})// @NamedQueries end
@NamedNativeQuery(name = MyEntity.INSERT_NATIVE, query = "insert into MyEntity(name)values(?)")


- Projects Window|Project|Source Packages|entity|MyEntity|Copy
- Projects Window|Project|Source Packages|entity|Refactor Copy|MyEntity1

The copied class contains two instances of @NamedNativeQuery(name = MyEntity1.INSERT_NATIVE
Comment 1 Jan Becicka 2011-10-10 12:59:53 UTC
*** Bug 203341 has been marked as a duplicate of this bug. ***
Comment 2 Jan Becicka 2011-10-10 13:01:47 UTC
Looks like source generator issue.
Comment 3 bht 2012-10-13 22:00:10 UTC
Could this please get higher priority?
Comment 4 Jan Lahoda 2012-10-25 14:04:33 UTC
Lets see if this is enough:
http://hg.netbeans.org/jet-main/rev/e57ec0a1062a
Comment 5 Quality Engineering 2012-10-26 01:29:01 UTC
Integrated into 'main-golden', will be available in build *201210260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e57ec0a1062a
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #203333: improving diffing of annotations.