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 - Allow to find out a persistence unit for DB connection
Summary: Allow to find out a persistence unit for DB connection
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Erno Mononen
Depends on:
Blocks: 89495 91757
  Show dependency tree
Reported: 2007-02-28 14:02 UTC by Jan Stola
Modified: 2007-03-16 13:14 UTC (History)
2 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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 

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.