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 96781

Summary: Allow to find out a persistence unit for DB connection
Product: javaee Reporter: Jan Stola <jstola>
Component: PersistenceAssignee: Erno Mononen <emononen>
Status: RESOLVED FIXED    
Severity: blocker CC: arseniy, pjiricka
Priority: P1    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: TASK Exception Reporter:
Bug Depends on:    
Bug Blocks: 89495, 91757    

Description Jan Stola 2007-02-28 14:02:43 UTC
Use case: user DnD DB table onto GUI form in order to display DB data in this 
form.

When the user drags the table we have to be able to find out whether there (=in 
the project) is an entity class that corresponds to the DB table. If there is 
not such a class, we will generate it. We need to be able to find a persistence 
unit for the given DB connection (e.g. given DB url, driver, username and 
password) to be able to find out whether the entity class exists and if not, to 
be able to add the generated class into the right persistence unit.

By now, we are able to find the existing persistence unit using 
ProviderUtil.getProvider(pUnit), Provider.*, ProviderUtil.getProperty(pUnit, 
propertyName) methods. If these methods are going to survive in NB 6.0, it is 
sufficient to add us (org.netbeans.modules.form.j2ee) as friends to 
j2ee\persistence module.
Comment 1 Petr Jiricka 2007-03-05 11:18:16 UTC
I see that the relevant methods in ProviderUtil still exist in the trunk
codebase, and Matisse is a friend of the persistence module. So if there are no
changes planned for 6.0, then we are done, right? 

Are we done then?
Comment 2 Erno Mononen 2007-03-05 12:53:44 UTC
From my point of view, though the methods still exist, I'd keep this open until 
the j2ee/persistence friend API has been cleaned up a bit (similarly to issue 
96777). There might be a need for some minor changes in some of the 
ProviderUtils methods. 
Comment 3 Erno Mononen 2007-03-16 13:14:52 UTC
I cleaned up the ProviderUtil class a bit and added / improved JavaDocs. The 
methods you need for this are still there and you've been added as a friend, so 
I'm closing this now.