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.
I always use Hibernate as my JPA2 provider - in both J2SE and J2EE. However, the NetBeans support for Hibernate is very poor and the "Create Persistence Provider" or graphical editor for persistence.xml always insists that Hibernate only has JPA1 support. Netbeans should support Hibernate as a JPA2 provider - if this means updating an ageing "Ant Library" then please do so. Details follow... My projects are all Maven based and the pom.xml entries amount to this (for a Derby backend) <dependency> <groupId>org.hibernate.javax.persistence</groupId> <artifactId>hibernate-jpa-2.0-api</artifactId> <version>1.0.1.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>4.1.5.SP1</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.9.1.0</version> <scope>runtime</scope> </dependency> <!-- consider using C3PO and ehcache --> <dependency> <!-- a dependency of Hibernate, which is locally managed --> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.6.6</version> <scope>runtime</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.6.6</version> <scope>runtime</scope> </dependency> I like to keep my J2SE persistence.xml very sparse and load properties from a properties file at runtime, e.g. containing hibernate.dialect = org.hibernate.dialect.DerbyDialect hibernate.connection.driver_class = org.apache.derby.jdbc.EmbeddedDriver hibernate.connection.url = jdbc:derby:MYDBNAME;create=true hibernate.connection.charSet = UTF-8 with a persistence.xml that usually looks like <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <!-- most properties are defined in jpa.properties --> <class>path.to.MyClass</class> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> </properties> </persistence-unit> </persistence>
netbeans support hibernate as jpa2.0 provider and if library is manually added it should be used in persistence area. but bundled one is jpa1.0 hibernate and updating is another issue and is covered by 206120 *** This bug has been marked as a duplicate of bug 206120 ***
ok, I miss "maven" and all above I said was about ant project, I can't say yet if new library with hibernate with jpa2.0 support will work fine, please reopen if not or I'll try myself later too.