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 190800 - Offer Hibernate as a JPA 2.0 implementation
Summary: Offer Hibernate as a JPA 2.0 implementation
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal with 2 votes (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-06 13:01 UTC by Petr Jiricka
Modified: 2014-02-08 20:54 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2010-10-06 13:01:55 UTC
Currently, when you create a Persistence Unit, you can choose several persistence providers, including "Hibernate (JPA 1.0)", which is included in the IDE by default.

However, Hibernate is now a JPA 2.0 implementation, so the JPA 2.0 option should be available too.

Could this be done, and what are the obstacles?

This will be also important if we support Java EE 6 development with JBoss 6 (see bug 185713): JBoss uses Hibernate as its default JPA implementation.
Comment 1 Sergey Petrov 2010-10-06 13:16:00 UTC
Current realization should support recognizing new library created by user as hibernate jpa2.0 provider and usage of the library/hibernate(jpa2.0) in jpa applications.
There are several subissues
-support hibernate jpa2.0 provider selection even if no library is created, may be if provider with specific name/type is supported/recognized in several versions it should be available in  version selection combobox instead of several items in providers combobox.
-recognize servers with hibernate jpa2.0
-upgrade bundled one to hibernate jap2.0 but it may affect other parts of hibernate support.
Comment 2 David Konecny 2010-10-07 00:39:36 UTC
We could bundle both of them, rigth? Hibernate(JPA1) and Hibernate(JPA2)
Comment 3 Sergey Petrov 2010-10-07 06:10:26 UTC
we can but it may not be good, each additional library increase "nb java se" distribution size.
Comment 4 Petr Jiricka 2010-10-07 13:34:58 UTC
Would it be possible to just bundle the latest one (currently 3.6.0.CR2) and use it as both JPA 1.0 and JPA 2.0 implementation, as we do with TopLink? That way, we would have the jar files just once, but we could have both Hibernate (JPA 1.) and Hibernate (JPA 2.0) persistence providers.
Comment 5 Sergey Petrov 2010-10-25 13:51:21 UTC
I'm looking to enable hibernate (jpa 2.0) selection for server based projects without having hibernate bundled for now. 
It seems to work correct, create proper persistence.xml and add or not add proper library but.
There is a side effects in visual editor as for gf3, there are jpa2.0 api on classpath and provider class is the same for jpa1.0 and jpa2.0 hibernate libraries, it's hard to determine what version to show in dropdown if both are supported, I'm looking for a way to handle it now.
Comment 6 Sergey Petrov 2010-10-25 14:06:40 UTC
I may need to change version detection from latest possible one to more probable one, may be it's possible to suppose user would like to use persistence 1.0 with hibernate jpa1.0 providers and not with hibernate jpa 2.0 providers even it's possible to use with hibernate jpa2.0, and if use hibernate jpa2.0 then use jpa2.0 itself and not alder one even it's possible to use older one. Other cases are corner one.
Comment 7 Quality Engineering 2010-10-26 02:45:07 UTC
Integrated into 'main-golden', will be available in build *201010260000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6e636de4c7eb
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: fix #190800 add hibernate 2.0 as supported provider to all projects even if now library was created
Comment 8 Sergey Petrov 2010-10-27 10:38:40 UTC
Petr, is tis enhancement about "offer" hibernate jpa2.0 provider or about bundled library also?
Comment 9 Petr Jiricka 2010-11-01 10:25:15 UTC
This is about the provider only. The bundled library is a separate thing (if we decide to do it at all).
Comment 10 Quality Engineering 2010-11-05 03:48:01 UTC
Integrated into 'main-golden', will be available in build *201011050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0d78ce2300b5
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: fix #190800 changed corresponding tests, as provider class is the same for both hibernate versions result is dependent on version logic
Comment 11 catweasle 2014-02-08 20:54:37 UTC
This feature is at least present in 7.4