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 74949 - Persistence Unit creation dialog should only offer the available pers.providers
Summary: Persistence Unit creation dialog should only offer the available pers.providers
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Nitya Doraisamy
URL:
Keywords:
Depends on: 75342 75356
Blocks:
  Show dependency tree
 
Reported: 2006-04-12 16:04 UTC by Petr Jiricka
Modified: 2006-06-22 12:51 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2006-04-12 16:04:10 UTC
NB 5.5 build from April 12, 2005

1. Create a web project
2. Launch the New Persistence Unit wizard
3. "Persistence Provider" field lists all three providers (TopLink, Hibernate,
KODO plus DEFAULT) 

=> it should only list those that are actually available on the server
Comment 1 Pavel Buzek 2006-04-14 19:44:00 UTC
BTW, I will use the same code in PU visual editor, once you create the code to
check the available providers pls fix it also there.
Comment 2 Libor Kotouc 2006-04-21 17:00:03 UTC
PU panel and PU wizard panel are prepared for getting the available persistence
providers from the server plugins.

The providers (Hibernate, TopLink, Kodo) are checked for availability by calling
J2eePlatform.isToolSupported(toolName:String):boolean where 
toolName == [org.netbeans.modules.j2ee.persistence.provider.Provider
implementation].getProviderClass(). 

There is also mechanism to find out whether some available provider is default
for the platform. For this purpose
J2eePlatform.isToolSupported(toolName:String):boolean is called with
toolName equal to one of following literals:
"hibernatePersistenceProviderIsDefault" for Hibernate,
"toplinkPersistenceProviderIsDefault" for TopLink,
"kodoPersistenceProviderIsDefault" for Kodo.

The typical implementation on the server plugin side may be following:

class J2eePlatformImplForSomePlugin extends J2eePlatformImpl {
...
   public boolean isToolSupported(String toolName) {
      ...
      //"org.hibernate.ejb.HibernatePersistence" ==
Provider.HIBERNATE_PROVIDER.getProviderClass()
      if ("org.hibernate.ejb.HibernatePersistence".equals(toolName)) {
         return <does this plugin contain Hibernate persistence provider?>;
      }
      if ("hibernatePersistenceProviderIsDefault".equals(toolName)) {
         return true;
      }
      ...
      return false;
   }
...
}

The toolName values and the whole mechanism of finding out the available
persistence providers are considered to be a temporary solution until we have
some API/SPI for that.

-----------------------------------------------------

cvs server: scheduling file `PersistenceProviderComboboxHelper.java' for
addition on branch `release55'
cvs server: use 'cvs commit' to add this file permanently
Checking in unit/PersistenceUnitPanel.form;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/unit/Attic/PersistenceUnitPanel.form,v
 <--  PersistenceUnitPanel.form
new revision: 1.1.2.4.2.12; previous revision: 1.1.2.4.2.11
done
Checking in unit/PersistenceUnitPanel.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/unit/Attic/PersistenceUnitPanel.java,v
 <--  PersistenceUnitPanel.java
new revision: 1.1.2.7.2.21; previous revision: 1.1.2.7.2.20
done
Checking in wizard/unit/PersistenceUnitWizardPanelDS.form;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/Attic/PersistenceUnitWizardPanelDS.form,v
 <--  PersistenceUnitWizardPanelDS.form
new revision: 1.1.2.2; previous revision: 1.1.2.1
done
Checking in wizard/unit/PersistenceUnitWizardPanelDS.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/unit/Attic/PersistenceUnitWizardPanelDS.java,v
 <--  PersistenceUnitWizardPanelDS.java
new revision: 1.1.2.4; previous revision: 1.1.2.3
done
RCS file:
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/util/Attic/PersistenceProviderComboboxHelper.java,v
done
Checking in util/PersistenceProviderComboboxHelper.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/util/Attic/PersistenceProviderComboboxHelper.java,v
 <--  PersistenceProviderComboboxHelper.java
new revision: 1.1.2.1; previous revision: 1.1
done
Comment 3 Libor Kotouc 2006-04-21 17:30:39 UTC
This issue can be closed if the implementation for the AS plugin is done, see
the issue 75356.
Comment 4 Nitya Doraisamy 2006-04-24 16:43:30 UTC
*** Issue 75356 has been marked as a duplicate of this issue. ***
Comment 5 Nitya Doraisamy 2006-04-26 21:58:09 UTC
Implementation for the AS plugin is done
Comment 6 Jindrich Sedek 2006-06-22 12:51:02 UTC
Verified NetBeans5.5Dev200606220200