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.
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.
The workaround doesn't seem to work consistently either - after adding 'implements Serializable' and adding import, still no hints appear.
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.
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?
Workaround: After importing javax.persistence.Entity, save the file, wait a couple of seconds, and then edit the file, and the hints should appear.
also see issue 154149
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.
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).
>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.
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