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 108993 - In @Entity classes, NB 6M10 identifies "static" fields as persistent attributes.
Summary: In @Entity classes, NB 6M10 identifies "static" fields as persistent attributes.
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-05 22:31 UTC by witoldsz
Modified: 2007-07-09 15:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description witoldsz 2007-07-05 22:31:07 UTC
For all my public static final variables in @Entity classes, NetBeans 6 M10 complains:
-----------------
Instance variable for a persistent attribute must not be public.
Persistent attribute should be encapsulated (have getter and setter)
-----------------

For compile-time safety and easy refactoring, all my @Entity classes declares:
public static final String PROPERTY_NAME = "propertyName";
for each property. All these are marked with red exclamation and above description, but they are not persistent attributes.
Comment 1 Tomasz Slota 2007-07-06 11:42:57 UTC
Taking over
Comment 2 Tomasz Slota 2007-07-09 09:41:31 UTC
XXX.getBasic() should not return static properties, this issue is caused directly by this problem 
Comment 3 Andrei Badea 2007-07-09 15:07:08 UTC
Fixed.

Checking in src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/AttributesHelper.java;
/cvs/j2ee/persistenceapi/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/AttributesHelper.java,v 
<--  AttributesHelper.java
new revision: 1.4; previous revision: 1.3
done
Checking in
test/unit/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityMappingsMetadataModelTest.java;
/cvs/j2ee/persistenceapi/test/unit/src/org/netbeans/modules/j2ee/persistenceapi/metadata/orm/annotation/EntityMappingsMetadataModelTest.java,v
 <--  EntityMappingsMetadataModelTest.java
new revision: 1.6; previous revision: 1.5
done