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.
Use Entity Manager action generates field for EntityManagerFactory and generates a sample method showing how to use the factory. It doesn't generate a new field if the class already contains a field for EntityManagerFactory - that's good, but it generates a field for a factory even if the class already contains a field for the EntityManager itself (which is common in J2SE application). Please, don't generate a field for a factory in that case and make sure that the generated sample method uses the existing entity manager.
I've update the action in the merged_model branch to use an existing EntityManager if there is one. I'll leave this issue open till the branch has been merged to trunk.
Closing as the branch has been merged to trunk now.