Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFLY-513 JPA 2.1 (switch to Hibernate 4.3.0.Beta2, JipiJapa, Container changes for JPA 2.1) #4486

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion appclient/pom.xml
Expand Up @@ -93,7 +93,7 @@

<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
</dependency>

<dependency>
Expand Down
15 changes: 10 additions & 5 deletions build/build.xml
Expand Up @@ -367,6 +367,10 @@
<maven-resource group="ch.qos.cal10n" artifact="cal10n-api"/>
</module-def>

<module-def name="com.fasterxml.classmate">
<maven-resource group="com.fasterxml" artifact="classmate" />
</module-def>

<module-def name="com.github.relaxng">
<maven-resource group="com.github.relaxng" artifact="relaxngDatatype" />
</module-def>
Expand Down Expand Up @@ -476,7 +480,7 @@
</module-def>

<module-def name="javax.persistence.api">
<maven-resource group="org.hibernate.javax.persistence" artifact="hibernate-jpa-2.0-api"/>
<maven-resource group="org.hibernate.javax.persistence" artifact="hibernate-jpa-2.1-api"/>
</module-def>

<module-def name="javax.resource.api">
Expand Down Expand Up @@ -870,19 +874,20 @@
</module-def>

<module-def name="org.jboss.as.jpa.hibernate" slot="3">
<maven-resource group="org.wildfly" artifact="wildfly-jpa-hibernate3"/>
<maven-resource group="org.jipijapa" artifact="hibernate3"/>
</module-def>

<module-def name="org.jboss.as.jpa.hibernate" slot="4">
<maven-resource group="org.wildfly" artifact="wildfly-jpa-hibernate4"/>
<maven-resource group="org.jipijapa" artifact="hibernate4-3"/>
</module-def>

<module-def name="org.jboss.as.jpa.openjpa">
<maven-resource group="org.wildfly" artifact="wildfly-jpa-openjpa"/>
<maven-resource group="org.jipijapa" artifact="openjpa"/>
</module-def>

<module-def name="org.jboss.as.jpa.spi">
<maven-resource group="org.wildfly" artifact="wildfly-jpa-spi"/>
<maven-resource group="org.jipijapa" artifact="core"/>
<maven-resource group="org.jipijapa" artifact="spi"/>
</module-def>

<module-def name="org.jboss.as.jpa.util">
Expand Down
38 changes: 24 additions & 14 deletions build/pom.xml
Expand Up @@ -245,6 +245,11 @@
<artifactId>cal10n-api</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml</groupId>
<artifactId>classmate</artifactId>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
Expand Down Expand Up @@ -734,7 +739,7 @@

<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -1212,8 +1217,8 @@
</dependency>

<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jpa-hibernate3</artifactId>
<groupId>org.jipijapa</groupId>
<artifactId>hibernate3</artifactId>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
Expand All @@ -1223,18 +1228,23 @@
</dependency>

<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jpa-hibernate4</artifactId>
<groupId>org.jipijapa</groupId>
<artifactId>hibernate4-3</artifactId>
</dependency>

<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jpa-openjpa</artifactId>
<groupId>org.jipijapa</groupId>
<artifactId>openjpa</artifactId>
</dependency>

<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jpa-spi</artifactId>
<groupId>org.jipijapa</groupId>
<artifactId>spi</artifactId>
</dependency>

<dependency>
<groupId>org.jipijapa</groupId>
<artifactId>core</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -2048,7 +2058,7 @@
<include>org.hibernate:hibernate-envers</include>
<include>org.hibernate:hibernate-infinispan</include>
<include>org.hibernate:hibernate-validator</include>
<include>org.hibernate.javax.persistence:hibernate-jpa-2.0-api</include>
<include>org.hibernate.javax.persistence:hibernate-jpa-2.1-api</include>
<include>org.hornetq:hornetq-commons</include>
<include>org.hornetq:hornetq-core-client</include>
<include>org.hornetq:hornetq-jms-client</include>
Expand Down Expand Up @@ -2237,10 +2247,10 @@
<exclude>org.wildfly:wildfly-jdr</exclude>
<exclude>org.wildfly:wildfly-jmx</exclude>
<exclude>org.wildfly:wildfly-jpa</exclude>
<exclude>org.wildfly:wildfly-jpa-hibernate3</exclude>
<exclude>org.wildfly:wildfly-jpa-hibernate4</exclude>
<exclude>org.wildfly:wildfly-jpa-openjpa</exclude>
<exclude>org.wildfly:wildfly-jpa-spi</exclude>
<exclude>org.jipijapa:hibernate3</exclude>
<exclude>org.jipijapa:hibernate4-3</exclude>
<exclude>org.jipijapa:openjpa</exclude>
<exclude>org.jipijapa:spi</exclude>
<exclude>org.wildfly:wildfly-jpa-util</exclude>
<exclude>org.wildfly:wildfly-jsf</exclude>
<exclude>org.wildfly:wildfly-jsf-injection</exclude>
Expand Down
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2013, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<module xmlns="urn:jboss:module:1.1" name="com.fasterxml.classmate">
<properties>
<property name="jboss.api" value="private"/>
</properties>

<resources>
<!-- Insert resources here -->
</resources>
</module>

Expand Up @@ -22,26 +22,31 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<!-- Represents the Hibernate 4.0.x module-->
<!-- Represents the Hibernate 4.3.x module-->
<module xmlns="urn:jboss:module:1.1" name="org.hibernate">
<resources>
<!-- Insert resources here -->
</resources>

<dependencies>
<module name="asm.asm"/>
<module name="com.fasterxml.classmate"/>
<module name="javax.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="javax.xml.bind.api"/>
<module name="org.antlr"/>
<module name="org.apache.commons.collections"/>
<module name="org.dom4j"/>
<module name="org.infinispan" optional="true"/>
<module name="org.javassist"/>
<module name="org.jboss.as.jpa.hibernate" slot="4" optional="true"/>
<module name="org.jboss.jandex"/>
<module name="org.jboss.logging"/>
<module name="org.hibernate.envers" services="import" optional="true"/>
<module name="org.hibernate.commons-annotations"/>

</dependencies>
</module>
Expand Up @@ -35,16 +35,21 @@
<module name="javax.annotation.api"/>
<module name="javax.api"/>
<module name="javax.ejb.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.persistence.api"/>
<module name="javax.resource.api"/>
<module name="javax.servlet.api" optional="true"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="org.apache.commons.collections"/>
<module name="org.hibernate.validator"/>
<module name="org.hibernate.validator" services="import"/>
<module name="org.infinispan"/>
<module name="org.jboss.common-beans"/>
<module name="org.jboss.as.connector" />
<module name="org.jboss.as.controller"/>
<module name="org.jboss.as.clustering.common"/>
<module name="org.jboss.as.clustering.jgroups"/>
<module name="org.jboss.as.clustering.infinispan"/>
<module name="org.jboss.as.ee"/>
<module name="org.jboss.as.ejb3"/>
<module name="org.jboss.as.jpa.spi"/>
Expand Down
Expand Up @@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.as.weld;
package org.jboss.as.ee.weld;

import org.jboss.as.server.deployment.AttachmentKey;
import org.jboss.as.server.deployment.DeploymentUnit;
Expand Down
2 changes: 1 addition & 1 deletion ejb3/pom.xml
Expand Up @@ -101,7 +101,7 @@ vi:ts=4:sw=4:expandtab

<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
</dependency>

<dependency>
Expand Down
Expand Up @@ -31,7 +31,7 @@
import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
import org.jboss.as.web.common.WarMetaData;
import org.jboss.as.weld.WeldDeploymentMarker;
import org.jboss.as.ee.weld.WeldDeploymentMarker;
import org.jboss.as.weld.deployment.WeldAttachments;
import org.jboss.metadata.javaee.spec.ParamValueMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
Expand Down
Expand Up @@ -29,7 +29,7 @@
import org.jboss.as.server.deployment.DeploymentUnitProcessor;
import org.jboss.as.server.deployment.module.ModuleDependency;
import org.jboss.as.server.deployment.module.ModuleSpecification;
import org.jboss.as.weld.WeldDeploymentMarker;
import org.jboss.as.ee.weld.WeldDeploymentMarker;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoader;
Expand Down
15 changes: 13 additions & 2 deletions jpa/core/pom.xml
Expand Up @@ -71,10 +71,16 @@
</dependency>

<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jpa-spi</artifactId>
<groupId>org.jipijapa</groupId>
<artifactId>spi</artifactId>
</dependency>

<dependency>
<groupId>org.jipijapa</groupId>
<artifactId>core</artifactId>
</dependency>


<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-jpa-util</artifactId>
Expand All @@ -100,5 +106,10 @@
<type>pom</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>
</dependencies>
</project>
Expand Up @@ -26,7 +26,7 @@
import java.lang.instrument.IllegalClassFormatException;
import java.security.ProtectionDomain;

import org.jboss.as.jpa.spi.PersistenceUnitMetadata;
import org.jipijapa.plugin.spi.PersistenceUnitMetadata;

/**
* Helps implement PersistenceUnitInfo.addClassTransformer() by using DelegatingClassFileTransformer
Expand Down
Expand Up @@ -22,7 +22,7 @@

package org.jboss.as.jpa.classloader;

import org.jboss.as.jpa.spi.TempClassLoaderFactory;
import org.jipijapa.plugin.spi.TempClassLoaderFactory;

/**
* Factory implementation that creates {@link TempClassLoader} instances.
Expand Down
26 changes: 19 additions & 7 deletions jpa/core/src/main/java/org/jboss/as/jpa/config/Configuration.java
Expand Up @@ -25,7 +25,8 @@
import java.util.HashMap;
import java.util.Map;

import org.jboss.as.jpa.spi.PersistenceUnitMetadata;
import org.jipijapa.plugin.spi.PersistenceUnitMetadata;


/**
* configuration properties that may appear in persistence.xml
Expand All @@ -39,9 +40,14 @@ public class Configuration {
public static final String PROVIDER_MODULE = "jboss.as.jpa.providerModule";

/**
* Hibernate 4 persistence provider
* Hibernate 4.3.x (default) persistence provider
*/
public static final String PROVIDER_MODULE_HIBERNATE4_3 = "org.hibernate";

/**
* Hibernate 4.1.x persistence provider, note that Hibernate 4.1.x is expected to be in the 4.1 slot
*/
public static final String PROVIDER_MODULE_HIBERNATE4 = "org.hibernate";
public static final String PROVIDER_MODULE_HIBERNATE4_1 = "org.hibernate:4.1";

/**
* Hibernate OGM persistence provider
Expand All @@ -66,12 +72,17 @@ public class Configuration {
/**
* default if no PROVIDER_MODULE is specified.
*/
public static final String PROVIDER_MODULE_DEFAULT = PROVIDER_MODULE_HIBERNATE4;
public static final String PROVIDER_MODULE_DEFAULT = PROVIDER_MODULE_HIBERNATE4_3;

/**
* Hibernate 4.1.x persistence provider class
*/
public static final String PROVIDER_CLASS_HIBERNATE4_1 = "org.hibernate.ejb.HibernatePersistence";

/**
* Hibernate persistence provider class
* Hibernate 4.3.x persistence provider class
*/
public static final String PROVIDER_CLASS_HIBERNATE = "org.hibernate.ejb.HibernatePersistence";
public static final String PROVIDER_CLASS_HIBERNATE = "org.hibernate.jpa.HibernatePersistenceProvider";

/**
* Hibernate OGM persistence provider class
Expand Down Expand Up @@ -157,7 +168,8 @@ public class Configuration {
static {
// always choose the default hibernate version for the Hibernate provider class mapping
// if the user wants a different version. they can specify the provider module name
providerClassToModuleName.put(PROVIDER_CLASS_HIBERNATE, PROVIDER_MODULE_HIBERNATE4);
providerClassToModuleName.put(PROVIDER_CLASS_HIBERNATE, PROVIDER_MODULE_HIBERNATE4_3);
providerClassToModuleName.put(PROVIDER_CLASS_HIBERNATE4_1, PROVIDER_MODULE_HIBERNATE4_1);
providerClassToModuleName.put(PROVIDER_CLASS_HIBERNATE_OGM, PROVIDER_MODULE_HIBERNATE_OGM);
providerClassToModuleName.put(PROVIDER_CLASS_TOPLINK_ESSENTIALS, PROVIDER_MODULE_TOPLINK);
providerClassToModuleName.put(PROVIDER_CLASS_TOPLINK, PROVIDER_MODULE_TOPLINK);
Expand Down
Expand Up @@ -27,7 +27,7 @@

import javax.persistence.spi.PersistenceProvider;

import org.jboss.as.jpa.spi.PersistenceProviderAdaptor;
import org.jipijapa.plugin.spi.PersistenceProviderAdaptor;

/**
* holds the deployed persistence provider + adaptor
Expand Down
Expand Up @@ -26,8 +26,8 @@

import javax.persistence.spi.PersistenceUnitInfo;

import org.jboss.as.jpa.spi.PersistenceUnitMetadata;
import org.jboss.as.server.deployment.AttachmentKey;
import org.jipijapa.plugin.spi.PersistenceUnitMetadata;

/**
* Holds the defined persistence units
Expand Down