Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 96781 - Allow to find out a persistence unit for DB connection
Allow to find out a persistence unit for DB connection
Product: javaee
Classification: Unclassified
Component: Persistence
All All
: P1 (vote)
: 6.x
Assigned To: Erno Mononen
Depends on:
Blocks: 89495 91757
  Show dependency treegraph
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


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.  

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo