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.
It would be nice to have an API for getting target platform's default persistence provider (i.e. container managed provider), something like J2eePlatform#getPersistenceProvider(). Method could return defined constants instead of Provider to avoid dependencies. Currently one has to retrieve server id (and know which id each server has since there's no API) and then resolve provider manually.
Currently supported providers are: Hibernate (JBoss) Toplink (Glassfish) Kodo (BEA) Respective constants (as in ProviderUtil): HIBERNATE_PROVIDER TOPLINK_PROVIDER KODO_PROVIDER
Erno, it is not clear what you want to achive with this API - how would it be used? I assume there is code that know what provider class to use for every persistence provider, what vendor specific properties to use, etc. Ideally this all would be part of this API and provided by the server plugin. If it is not (and it is hardwired in j2ee/persistence?) then you could as well hardwire everything. This seems like a half of the solution. Or maybe I missunderstood.
I agree that it is not a complete solution. The specific case that I had was that there was (is) no API for retrieving the actual server, so you have to write things like: if ("J2EE".equals(j2eeModuleProvider.getServerID)) // return toplink else if ("JBoss".equals(j2eeModuleProvider.getServerID)) / return hibernate ... And you have to know those strings ("J2EE", "JBoss") by heart since there is no API for them, which in my opinion is rather ugly. So my initial need was just to have an API to retrieve the actual server, API for getting providers followed that. Ideal case (from my point of view) would be to have server plugins to return actual providers, since I think that it would be quite logical for server to know its provider(s). I understand that this is probably not doable because of the dependencies it would create, so returning constants seems like the second best option. This way adding new server plugins wouldn't require changes in j2ee/persistence (assuming that appropriate Provider is already implemented).
Is this still needed? If so, what's the next step?
this is not going to be fixed in 5.5. TM -> Dev
Already resolved by javaee.specs.support.