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 147368 - Hints not working for @Entity
Summary: Hints not working for @Entity
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker with 1 vote (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-16 13:11 UTC by Geertjan Wielenga
Modified: 2016-07-07 08:54 UTC (History)
1 user (show)

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 Geertjan Wielenga 2008-09-16 13:11:37 UTC
1. Remove user dir.
2. Start IDE. 
3. Create new Java application.
4. Right-click Libraries node, choose Add Library, and select "Persistence".
5. Create new Java class named 'Customer'.
6. Type @Entity above the class declaration.
7. Click the Hint to add the 'javax.persistence.Entity' import statement.
8. BUG: There are now no further Hints! Hint should appear for creating serializable, persistence unit, and entity ID.
9. Workaround: type "implements Serializable", this triggers the other hints.

This is an intermittent problem, sometimes it works correctly, sometimes not. Tried on Windows and on Ubuntu, 6.5 Beta.
Comment 1 Troy Giunipero 2008-09-16 13:20:29 UTC
The workaround doesn't seem to work consistently either - after adding 'implements Serializable' and adding import,
still no hints appear.
Comment 2 Andrei Badea 2008-09-16 13:31:52 UTC
I have seen this too. The problem is that the entity mapping model is only refreshed when the entity class is saved. So
before saving the file, there is no entity class in the model, so the hints don't recognize the class as an entity class.
Comment 3 Troy Giunipero 2008-09-16 13:37:55 UTC
We've tried saving the file as you suggest, but still no hints seem to display.  Would the new Compile on Save feature
have something to do with this?
Comment 4 Troy Giunipero 2008-09-16 14:20:55 UTC
Workaround:  After importing javax.persistence.Entity, save the file, wait a couple of seconds, and then edit the file,
and the hints should appear.
Comment 5 Dongmei Cao 2008-12-04 00:12:39 UTC
also see issue 154149
Comment 6 Sergey Petrov 2009-10-01 12:07:53 UTC
in 6.8(091001)  I see new hints right after saving in less then a second (do not need to add serializable and do not
need to edit after save) but as it's initially reported as "intermittent problem" it may be specific to my system only.
Comment 7 Sergey Petrov 2010-10-20 14:54:11 UTC
In my opinion it's not P3 issue but something like P4 may be or not an issue (if it works always after save now).
Also entity is still an entity in internal model after @Entity removal but before save, and is listed in JPA controller wizards etc. These wizards need to perform save on invocation to avoid uncertainty (also currently nothing good will be generated).
Comment 8 Sergey Petrov 2011-03-16 14:25:46 UTC
>p4 as there was no objections or new comments and it works right after save now and it was created to work this way. it still may be good to handle unsaved cases also.
Comment 9 Martin Balin 2016-07-07 08:54:22 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss