HHH-9680 updated OSGi quickstarts, added necessary contracts to Envers blueprint, corrected a few uses of ReflectionManager
This commit is contained in:
parent
212f61a24c
commit
410a785dfe
|
@ -1,75 +1,75 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<features>
|
<features>
|
||||||
<feature name="hibernate-test">
|
<feature name="hibernate-test">
|
||||||
|
|
||||||
<feature>karaf-framework</feature>
|
<!-- JTA -->
|
||||||
|
<config name="org.apache.aries.transaction">
|
||||||
|
aries.transaction.recoverable = true
|
||||||
|
aries.transaction.timeout = 600
|
||||||
|
aries.transaction.howl.logFileDir = /tmp/karaf/txlog
|
||||||
|
aries.transaction.howl.maxLogFiles = 2
|
||||||
|
aries.transaction.howl.maxBlocksPerFile = 512
|
||||||
|
aries.transaction.howl.bufferSizeKBytes = 4
|
||||||
|
</config>
|
||||||
|
<bundle dependency="true" start-level="30">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
|
||||||
|
<bundle start-level="30">mvn:org.apache.aries.transaction/org.apache.aries.transaction.blueprint/1.0.0</bundle>
|
||||||
|
<bundle start-level="30">mvn:org.apache.aries.transaction/org.apache.aries.transaction.manager/1.0.1</bundle>
|
||||||
|
|
||||||
<!-- JTA -->
|
<!-- JPA -->
|
||||||
<config name="org.apache.aries.transaction">
|
<bundle start-level="30">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
|
||||||
aries.transaction.recoverable = true
|
<!-- No container currently supports JPA 2.1. Clone and build Aries from the following fork (upgrades to
|
||||||
aries.transaction.timeout = 600
|
JPA 2.1). Aries should be upgrading as soon as the spec is out.
|
||||||
aries.transaction.howl.logFileDir = /tmp/karaf/txlog
|
https://github.com/brmeyer/aries/tree/jpa21 -->
|
||||||
aries.transaction.howl.maxLogFiles = 2
|
<bundle start-level="30">mvn:org.apache.aries/org.apache.aries.util/1.1.1-SNAPSHOT</bundle>
|
||||||
aries.transaction.howl.maxBlocksPerFile = 512
|
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.api/1.0.1-SNAPSHOT</bundle>
|
||||||
aries.transaction.howl.bufferSizeKBytes = 4
|
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.blueprint.aries/1.0.2-SNAPSHOT</bundle>
|
||||||
</config>
|
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/1.0.1-SNAPSHOT</bundle>
|
||||||
<bundle dependency="true" start-level="30">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
|
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container.context/1.0.2-SNAPSHOT</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.transaction/org.apache.aries.transaction.blueprint/1.0.0</bundle>
|
|
||||||
<bundle start-level="30">mvn:org.apache.aries.transaction/org.apache.aries.transaction.manager/1.0.1</bundle>
|
|
||||||
|
|
||||||
<!-- JPA -->
|
<!-- JNDI -->
|
||||||
<bundle start-level="30">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
|
<bundle start-level="30">mvn:org.apache.aries/org.apache.aries.util/1.0.0</bundle>
|
||||||
<!-- No container currently supports JPA 2.1. Clone and build Aries from the following fork (upgrades to
|
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.api/1.0.0</bundle>
|
||||||
JPA 2.1). Aries should be upgrading as soon as the spec is out.
|
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.core/1.0.0</bundle>
|
||||||
https://github.com/brmeyer/aries/tree/jpa21 -->
|
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.rmi/1.0.0</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries/org.apache.aries.util/1.1.1-SNAPSHOT</bundle>
|
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.url/1.0.0</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.api/1.0.1-SNAPSHOT</bundle>
|
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.legacy.support/1.0.0</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.blueprint.aries/1.0.2-SNAPSHOT</bundle>
|
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/1.0.1-SNAPSHOT</bundle>
|
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container.context/1.0.2-SNAPSHOT</bundle>
|
|
||||||
|
|
||||||
<!-- JNDI -->
|
<!-- Taken from Karaf-Tutorial -->
|
||||||
<bundle start-level="30">mvn:org.apache.aries/org.apache.aries.util/1.0.0</bundle>
|
<bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.api/1.0.0</bundle>
|
<bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.core/1.0.0</bundle>
|
<bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.rmi/1.0.0</bundle>
|
<bundle>mvn:commons-lang/commons-lang/2.6</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.url/1.0.0</bundle>
|
<bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>
|
||||||
<bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.legacy.support/1.0.0</bundle>
|
|
||||||
|
|
||||||
<!-- Taken from Karaf-Tutorial -->
|
<bundle>mvn:com.h2database/h2/1.3.170</bundle>
|
||||||
<bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
|
<bundle>blueprint:file:/[PATH]/datasource-h2.xml</bundle>
|
||||||
<bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
|
|
||||||
<bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
|
|
||||||
<bundle>mvn:commons-lang/commons-lang/2.6</bundle>
|
|
||||||
<bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>
|
|
||||||
|
|
||||||
<bundle>mvn:com.h2database/h2/1.3.170</bundle>
|
<!-- These do not natively support OSGi, so using 3rd party bundles. -->
|
||||||
<bundle>blueprint:file:/[PATH]/datasource-h2.xml</bundle>
|
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
|
||||||
|
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
|
||||||
|
|
||||||
<!-- These do not natively support OSGi, so using 3rd party bundles. -->
|
<!-- These do not natively support OSGi, so wrap with BND. -->
|
||||||
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
|
<bundle>wrap:mvn:org.jboss/jandex/1.1.0.Final</bundle>
|
||||||
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
|
|
||||||
|
|
||||||
<!-- These do not natively support OSGi, so wrap with BND. -->
|
<bundle>mvn:com.fasterxml/classmate/0.8.0</bundle>
|
||||||
<bundle>wrap:mvn:org.jboss/jandex/1.1.0.Alpha1</bundle>
|
<bundle>mvn:org.apache.logging.log4j/log4j-api/2.0</bundle>
|
||||||
|
<bundle>mvn:log4j/log4j/1.2.17</bundle>
|
||||||
|
<bundle>mvn:org.jboss.logging/jboss-logging/3.2.1.Final</bundle>
|
||||||
|
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
|
||||||
|
|
||||||
<bundle>mvn:com.fasterxml/classmate/0.8.0</bundle>
|
<bundle>mvn:org.hibernate.common/hibernate-commons-annotations/4.0.5.Final</bundle>
|
||||||
<bundle>mvn:org.jboss.logging/jboss-logging/3.1.0.GA</bundle>
|
|
||||||
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
|
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate.common/hibernate-commons-annotations/4.0.3.Final</bundle>
|
<bundle>mvn:org.hibernate/hibernate-core/5.0.0-SNAPSHOT</bundle>
|
||||||
|
<bundle>mvn:org.hibernate/hibernate-entitymanager/5.0.0-SNAPSHOT</bundle>
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate/hibernate-core/4.3.0-SNAPSHOT</bundle>
|
<!-- TODO: It seems that the persistence unit bundle needs to be started
|
||||||
<bundle>mvn:org.hibernate/hibernate-entitymanager/4.3.0-SNAPSHOT</bundle>
|
before hibernate-osgi. When the BundleActivator is started,
|
||||||
|
the persistence unit is provided even though managed-jpa
|
||||||
|
hasn't completely started yet. If that happens, you'll get an "illegal
|
||||||
|
bundle state" exception. Is there a way for the activator to
|
||||||
|
watch for bundles with PUs before registering the persistence provider? -->
|
||||||
|
<bundle>mvn:org.hibernate.osgi/managed-jpa/1.0.0</bundle>
|
||||||
|
|
||||||
<!-- TODO: It seems that the persistence unit bundle needs to be started
|
<bundle>mvn:org.hibernate/hibernate-osgi/5.0.0-SNAPSHOT</bundle>
|
||||||
before hibernate-osgi. When the BundleActivator is started,
|
</feature>
|
||||||
the persistence unit is provided even though managed-jpa
|
|
||||||
hasn't completely started yet. If that happens, you'll get an "illegal
|
|
||||||
bundle state" exception. Is there a way for the activator to
|
|
||||||
watch for bundles with PUs before registering the persistence provider? -->
|
|
||||||
<bundle>mvn:org.hibernate.osgi/managed-jpa/1.0.0</bundle>
|
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate/hibernate-osgi/4.3.0-SNAPSHOT</bundle>
|
|
||||||
</feature>
|
|
||||||
</features>
|
</features>
|
||||||
|
|
|
@ -1,64 +1,64 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.hibernate.osgi</groupId>
|
<groupId>org.hibernate.osgi</groupId>
|
||||||
<artifactId>managed-jpa</artifactId>
|
<artifactId>managed-jpa</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<packaging>bundle</packaging>
|
<packaging>bundle</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate.javax.persistence</groupId>
|
<groupId>org.hibernate.javax.persistence</groupId>
|
||||||
<artifactId>hibernate-jpa-2.1-api</artifactId>
|
<artifactId>hibernate-jpa-2.1-api</artifactId>
|
||||||
<version>1.0.0.Final</version>
|
<version>1.0.0.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.osgi</groupId>
|
<groupId>org.osgi</groupId>
|
||||||
<artifactId>org.osgi.core</artifactId>
|
<artifactId>org.osgi.core</artifactId>
|
||||||
<version>4.3.1</version>
|
<version>4.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.osgi</groupId>
|
<groupId>org.osgi</groupId>
|
||||||
<artifactId>org.osgi.enterprise</artifactId>
|
<artifactId>org.osgi.enterprise</artifactId>
|
||||||
<version>4.2.0</version>
|
<version>4.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.karaf.shell</groupId>
|
<groupId>org.apache.karaf.shell</groupId>
|
||||||
<artifactId>org.apache.karaf.shell.console</artifactId>
|
<artifactId>org.apache.karaf.shell.console</artifactId>
|
||||||
<version>2.3.0</version>
|
<version>2.3.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.felix</groupId>
|
<groupId>org.apache.felix</groupId>
|
||||||
<artifactId>maven-bundle-plugin</artifactId>
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<instructions>
|
<instructions>
|
||||||
<Bundle-SymbolicName>org.hibernate.osgi.managed-jpa</Bundle-SymbolicName>
|
<Bundle-SymbolicName>org.hibernate.osgi.managed-jpa</Bundle-SymbolicName>
|
||||||
<Bundle-Name>managed-jpa</Bundle-Name>
|
<Bundle-Name>managed-jpa</Bundle-Name>
|
||||||
<Bundle-Version>1.0.0</Bundle-Version>
|
<Bundle-Version>1.0.0</Bundle-Version>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
org.hibernate.osgitest,
|
org.hibernate.osgitest,
|
||||||
org.hibernate.osgitest.entity
|
org.hibernate.osgitest.entity
|
||||||
</Export-Package>
|
</Export-Package>
|
||||||
<Import-Package>
|
<Import-Package>
|
||||||
org.apache.felix.service.command,
|
org.apache.felix.service.command,
|
||||||
org.apache.felix.gogo.commands,
|
org.apache.felix.gogo.commands,
|
||||||
org.apache.karaf.shell.console,
|
org.apache.karaf.shell.console,
|
||||||
org.apache.karaf.shell.commands,
|
org.apache.karaf.shell.commands,
|
||||||
javax.persistence;version="[1.0.0,2.1.0]",
|
javax.persistence;version="[1.0.0,2.1.0]",
|
||||||
<!-- Needed for proxying's Javassist enhancement during runtime -->
|
<!-- Needed for proxying's Javassist enhancement during runtime -->
|
||||||
org.hibernate.proxy,
|
org.hibernate.proxy,
|
||||||
javassist.util.proxy,
|
javassist.util.proxy,
|
||||||
*
|
*
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
<Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
|
<Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
|
||||||
</instructions>
|
</instructions>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -17,18 +17,18 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<blueprint default-activation="eager"
|
<blueprint default-activation="eager"
|
||||||
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
|
xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0"
|
||||||
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0">
|
xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0">
|
||||||
|
|
||||||
<!-- This gets the container-managed EntityManager and injects it into the DataPointServiceImpl bean. -->
|
<!-- This gets the container-managed EntityManager and injects it into the DataPointServiceImpl bean. -->
|
||||||
<bean id="dpService" class="org.hibernate.osgitest.DataPointServiceImpl">
|
<bean id="dpService" class="org.hibernate.osgitest.DataPointServiceImpl">
|
||||||
<jpa:context unitname="managed-jpa" property="entityManager"/>
|
<jpa:context unitname="managed-jpa" property="entityManager"/>
|
||||||
<tx:transaction method="*" value="Required"/>
|
<tx:transaction method="*" value="Required"/>
|
||||||
</bean>
|
</bean>
|
||||||
<service ref="dpService" interface="org.hibernate.osgitest.DataPointService" />
|
<service ref="dpService" interface="org.hibernate.osgitest.DataPointService"/>
|
||||||
|
|
||||||
<!-- This demonstrates how to register your custom implementations of Hibernate extension points, such as
|
<!-- This demonstrates how to register your custom implementations of Hibernate extension points, such as
|
||||||
Integrator and TypeContributor. -->
|
Integrator and TypeContributor. -->
|
||||||
|
@ -39,20 +39,20 @@
|
||||||
|
|
||||||
<!-- This bundle makes use of Karaf commands to demonstrate core persistence operations. Feel free to remove it. -->
|
<!-- This bundle makes use of Karaf commands to demonstrate core persistence operations. Feel free to remove it. -->
|
||||||
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
|
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
|
||||||
<command name="dp/add">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.AddCommand">
|
<action class="org.hibernate.osgitest.command.AddCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp/getAll">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.GetAllCommand">
|
<action class="org.hibernate.osgitest.command.GetAllCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp/deleteAll">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.DeleteAllCommand">
|
<action class="org.hibernate.osgitest.command.DeleteAllCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
</command-bundle>
|
</command-bundle>
|
||||||
</blueprint>
|
</blueprint>
|
||||||
|
|
|
@ -1,41 +1,41 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<features>
|
<features>
|
||||||
<feature name="hibernate-test">
|
<feature name="hibernate-test">
|
||||||
|
|
||||||
<feature>karaf-framework</feature>
|
<!-- JTA -->
|
||||||
|
<bundle start-level="30">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
|
||||||
|
|
||||||
<!-- JTA -->
|
<!-- JPA -->
|
||||||
<bundle start-level="30">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
|
<bundle start-level="30">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
|
||||||
|
|
||||||
<!-- JPA -->
|
<!-- Taken from Karaf-Tutorial -->
|
||||||
<bundle start-level="30">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
|
<bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
|
||||||
|
<bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
|
||||||
|
<bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
|
||||||
|
<bundle>mvn:commons-lang/commons-lang/2.6</bundle>
|
||||||
|
<bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>
|
||||||
|
|
||||||
<!-- Taken from Karaf-Tutorial -->
|
<bundle>mvn:com.h2database/h2/1.3.170</bundle>
|
||||||
<bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
|
|
||||||
<bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
|
|
||||||
<bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
|
|
||||||
<bundle>mvn:commons-lang/commons-lang/2.6</bundle>
|
|
||||||
<bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>
|
|
||||||
|
|
||||||
<bundle>mvn:com.h2database/h2/1.3.170</bundle>
|
<!-- These do not natively support OSGi, so using 3rd party bundles. -->
|
||||||
|
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
|
||||||
|
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
|
||||||
|
|
||||||
<!-- These do not natively support OSGi, so using 3rd party bundles. -->
|
<!-- These do not natively support OSGi, so wrap with BND. -->
|
||||||
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
|
<bundle>wrap:mvn:org.jboss/jandex/1.1.0.Final</bundle>
|
||||||
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
|
|
||||||
|
|
||||||
<!-- These do not natively support OSGi, so wrap with BND. -->
|
<bundle>mvn:com.fasterxml/classmate/0.8.0</bundle>
|
||||||
<bundle>wrap:mvn:org.jboss/jandex/1.1.0.Alpha1</bundle>
|
<bundle>mvn:org.apache.logging.log4j/log4j-api/2.0</bundle>
|
||||||
|
<bundle>mvn:log4j/log4j/1.2.17</bundle>
|
||||||
|
<bundle>mvn:org.jboss.logging/jboss-logging/3.2.1.Final</bundle>
|
||||||
|
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
|
||||||
|
|
||||||
<bundle>mvn:com.fasterxml/classmate/0.8.0</bundle>
|
<bundle>mvn:org.hibernate.common/hibernate-commons-annotations/4.0.5.Final</bundle>
|
||||||
<bundle>mvn:org.jboss.logging/jboss-logging/3.1.0.GA</bundle>
|
|
||||||
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
|
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate.common/hibernate-commons-annotations/4.0.3.Final</bundle>
|
<bundle>mvn:org.hibernate/hibernate-core/5.0.0-SNAPSHOT</bundle>
|
||||||
|
<bundle>mvn:org.hibernate/hibernate-entitymanager/5.0.0-SNAPSHOT</bundle>
|
||||||
|
<bundle>mvn:org.hibernate/hibernate-osgi/5.0.0-SNAPSHOT</bundle>
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate/hibernate-core/4.3.0-SNAPSHOT</bundle>
|
<bundle>mvn:org.hibernate.osgi/unmanaged-jpa/1.0.0</bundle>
|
||||||
<bundle>mvn:org.hibernate/hibernate-entitymanager/4.3.0-SNAPSHOT</bundle>
|
</feature>
|
||||||
<bundle>mvn:org.hibernate/hibernate-osgi/4.3.0-SNAPSHOT</bundle>
|
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate.osgi/unmanaged-jpa/1.0.0</bundle>
|
|
||||||
</feature>
|
|
||||||
</features>
|
</features>
|
||||||
|
|
|
@ -1,75 +1,75 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.hibernate.osgi</groupId>
|
<groupId>org.hibernate.osgi</groupId>
|
||||||
<artifactId>unmanaged-jpa</artifactId>
|
<artifactId>unmanaged-jpa</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<packaging>bundle</packaging>
|
<packaging>bundle</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate.javax.persistence</groupId>
|
<groupId>org.hibernate.javax.persistence</groupId>
|
||||||
<artifactId>hibernate-jpa-2.1-api</artifactId>
|
<artifactId>hibernate-jpa-2.1-api</artifactId>
|
||||||
<version>1.0.0.Final</version>
|
<version>1.0.0.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.osgi</groupId>
|
<groupId>org.osgi</groupId>
|
||||||
<artifactId>org.osgi.core</artifactId>
|
<artifactId>org.osgi.core</artifactId>
|
||||||
<version>4.3.1</version>
|
<version>4.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.osgi</groupId>
|
<groupId>org.osgi</groupId>
|
||||||
<artifactId>org.osgi.enterprise</artifactId>
|
<artifactId>org.osgi.enterprise</artifactId>
|
||||||
<version>4.2.0</version>
|
<version>4.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.karaf.shell</groupId>
|
<groupId>org.apache.karaf.shell</groupId>
|
||||||
<artifactId>org.apache.karaf.shell.console</artifactId>
|
<artifactId>org.apache.karaf.shell.console</artifactId>
|
||||||
<version>2.3.0</version>
|
<version>2.3.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-entitymanager</artifactId>
|
<artifactId>hibernate-entitymanager</artifactId>
|
||||||
<version>4.3.0-SNAPSHOT</version>
|
<version>5.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>1.3.170</version>
|
<version>1.3.170</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.felix</groupId>
|
<groupId>org.apache.felix</groupId>
|
||||||
<artifactId>maven-bundle-plugin</artifactId>
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<instructions>
|
<instructions>
|
||||||
<Bundle-SymbolicName>org.hibernate.osgi.unmanaged-jpa</Bundle-SymbolicName>
|
<Bundle-SymbolicName>org.hibernate.osgi.unmanaged-jpa</Bundle-SymbolicName>
|
||||||
<Bundle-Name>unmanaged-jpa</Bundle-Name>
|
<Bundle-Name>unmanaged-jpa</Bundle-Name>
|
||||||
<Bundle-Version>1.0.0</Bundle-Version>
|
<Bundle-Version>1.0.0</Bundle-Version>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
org.hibernate.osgitest,
|
org.hibernate.osgitest,
|
||||||
org.hibernate.osgitest.entity
|
org.hibernate.osgitest.entity
|
||||||
</Export-Package>
|
</Export-Package>
|
||||||
<Import-Package>
|
<Import-Package>
|
||||||
org.apache.felix.service.command,
|
org.apache.felix.service.command,
|
||||||
org.apache.felix.gogo.commands,
|
org.apache.felix.gogo.commands,
|
||||||
org.apache.karaf.shell.console,
|
org.apache.karaf.shell.console,
|
||||||
org.apache.karaf.shell.commands,
|
org.apache.karaf.shell.commands,
|
||||||
org.h2,
|
org.h2,
|
||||||
javax.persistence;version="[1.0.0,2.1.0]",
|
javax.persistence;version="[1.0.0,2.1.0]",
|
||||||
<!-- Needed for proxying's Javassist enhancement during runtime -->
|
<!-- Needed for proxying's Javassist enhancement during runtime -->
|
||||||
org.hibernate.proxy,
|
org.hibernate.proxy,
|
||||||
javassist.util.proxy,
|
javassist.util.proxy,
|
||||||
*
|
*
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
</instructions>
|
</instructions>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -20,10 +20,9 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.osgitest;
|
package org.hibernate.osgitest;
|
||||||
|
|
||||||
import org.hibernate.cfg.Configuration;
|
import org.hibernate.boot.Metadata;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.integrator.spi.Integrator;
|
import org.hibernate.integrator.spi.Integrator;
|
||||||
import org.hibernate.metamodel.source.MetadataImplementor;
|
|
||||||
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,16 +31,15 @@ import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
||||||
*/
|
*/
|
||||||
public class TestIntegrator implements Integrator {
|
public class TestIntegrator implements Integrator {
|
||||||
|
|
||||||
public void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
public void integrate(
|
||||||
System.out.println("Integrator#integrate");
|
Metadata metadata,
|
||||||
}
|
SessionFactoryImplementor sessionFactory,
|
||||||
|
SessionFactoryServiceRegistry serviceRegistry) {
|
||||||
|
System.out.println("Integrator#integrate");
|
||||||
|
}
|
||||||
|
|
||||||
public void integrate(MetadataImplementor metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
||||||
System.out.println("Integrator#integrate");
|
System.out.println("Integrator#disintegrate");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
|
||||||
System.out.println("Integrator#disintegrate");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.osgitest;
|
package org.hibernate.osgitest;
|
||||||
|
|
||||||
import org.hibernate.metamodel.spi.TypeContributions;
|
import org.hibernate.boot.model.TypeContributions;
|
||||||
import org.hibernate.metamodel.spi.TypeContributor;
|
import org.hibernate.boot.model.TypeContributor;
|
||||||
import org.hibernate.service.ServiceRegistry;
|
import org.hibernate.service.ServiceRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ import org.hibernate.service.ServiceRegistry;
|
||||||
*/
|
*/
|
||||||
public class TestTypeContributor implements TypeContributor {
|
public class TestTypeContributor implements TypeContributor {
|
||||||
|
|
||||||
public void contribute(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
|
public void contribute(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
|
||||||
System.out.println("TypeContributor#contribute");
|
System.out.println("TypeContributor#contribute");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<blueprint default-activation="eager"
|
<blueprint default-activation="eager"
|
||||||
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
|
||||||
<bean id="dpService" class="org.hibernate.osgitest.DataPointServiceImpl"/>
|
<bean id="dpService" class="org.hibernate.osgitest.DataPointServiceImpl"/>
|
||||||
<service ref="dpService" interface="org.hibernate.osgitest.DataPointService" />
|
<service ref="dpService" interface="org.hibernate.osgitest.DataPointService"/>
|
||||||
|
|
||||||
<!-- This demonstrates how to register your custom implementations of Hibernate extension points. -->
|
<!-- This demonstrates how to register your custom implementations of Hibernate extension points. -->
|
||||||
|
|
||||||
|
@ -30,32 +30,33 @@
|
||||||
<service ref="integrator" interface="org.hibernate.integrator.spi.Integrator"/>
|
<service ref="integrator" interface="org.hibernate.integrator.spi.Integrator"/>
|
||||||
|
|
||||||
<bean id="strategyRegistrationProvider" class="org.hibernate.osgitest.TestStrategyRegistrationProvider"/>
|
<bean id="strategyRegistrationProvider" class="org.hibernate.osgitest.TestStrategyRegistrationProvider"/>
|
||||||
<service ref="strategyRegistrationProvider" interface="org.hibernate.boot.registry.selector.StrategyRegistrationProvider"/>
|
<service ref="strategyRegistrationProvider"
|
||||||
|
interface="org.hibernate.boot.registry.selector.StrategyRegistrationProvider"/>
|
||||||
|
|
||||||
<bean id="typeContributor" class="org.hibernate.osgitest.TestTypeContributor"/>
|
<bean id="typeContributor" class="org.hibernate.osgitest.TestTypeContributor"/>
|
||||||
<service ref="typeContributor" interface="org.hibernate.boot.model.TypeContributor"/>
|
<service ref="typeContributor" interface="org.hibernate.boot.model.TypeContributor"/>
|
||||||
|
|
||||||
<!-- This bundle makes use of Karaf commands to demonstrate core persistence operations. Feel free to remove it. -->
|
<!-- This bundle makes use of Karaf commands to demonstrate core persistence operations. Feel free to remove it. -->
|
||||||
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
|
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
|
||||||
<command name="dp:add">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.AddCommand">
|
<action class="org.hibernate.osgitest.command.AddCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:update">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.UpdateCommand">
|
<action class="org.hibernate.osgitest.command.UpdateCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:getAll">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.GetAllCommand">
|
<action class="org.hibernate.osgitest.command.GetAllCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:deleteAll">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.DeleteAllCommand">
|
<action class="org.hibernate.osgitest.command.DeleteAllCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
</command-bundle>
|
</command-bundle>
|
||||||
</blueprint>
|
</blueprint>
|
||||||
|
|
|
@ -1,71 +1,73 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<features>
|
<features>
|
||||||
<feature name="hibernate-test">
|
<feature name="hibernate-test">
|
||||||
|
|
||||||
<feature>karaf-framework</feature>
|
<!--<feature>karaf-framework</feature>-->
|
||||||
|
|
||||||
<!-- JTA -->
|
<!-- JTA -->
|
||||||
<bundle start-level="30">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
|
<bundle start-level="30">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
|
||||||
|
|
||||||
<!-- JPA -->
|
<!-- JPA -->
|
||||||
<bundle start-level="30">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
|
<bundle start-level="30">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
|
||||||
|
|
||||||
<!-- Taken from Karaf-Tutorial -->
|
<!-- Taken from Karaf-Tutorial -->
|
||||||
<bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
|
<bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
|
||||||
<bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
|
<bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
|
||||||
<bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
|
<bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
|
||||||
<bundle>mvn:commons-lang/commons-lang/2.6</bundle>
|
<bundle>mvn:commons-lang/commons-lang/2.6</bundle>
|
||||||
<bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>
|
<bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>
|
||||||
|
|
||||||
<bundle>mvn:com.h2database/h2/1.3.170</bundle>
|
<bundle>mvn:com.h2database/h2/1.3.170</bundle>
|
||||||
|
|
||||||
<!-- These do not natively support OSGi, so using 3rd party bundles. -->
|
<!-- These do not natively support OSGi, so using 3rd party bundles. -->
|
||||||
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
|
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
|
||||||
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
|
<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>
|
||||||
|
|
||||||
<!-- These do not natively support OSGi, so wrap with BND. -->
|
<!-- These do not natively support OSGi, so wrap with BND. -->
|
||||||
<bundle>wrap:mvn:org.jboss/jandex/1.1.0.Alpha1</bundle>
|
<bundle>wrap:mvn:org.jboss/jandex/1.1.0.Final</bundle>
|
||||||
<!-- Optional. Needed to test C3P0 connection pools. -->
|
<!-- Optional. Needed to test C3P0 connection pools. -->
|
||||||
<!-- <bundle>wrap:mvn:c3p0/c3p0/0.9.1</bundle> -->
|
<!-- <bundle>wrap:mvn:c3p0/c3p0/0.9.1</bundle> -->
|
||||||
<!-- Optional. Needed to test Proxool connection pools. -->
|
<!-- Optional. Needed to test Proxool connection pools. -->
|
||||||
<!-- <bundle>wrap:mvn:proxool/proxool/0.8.3</bundle> -->
|
<!-- <bundle>wrap:mvn:proxool/proxool/0.8.3</bundle> -->
|
||||||
<!-- Optional. Needed to test ehcache 2lc. -->
|
<!-- Optional. Needed to test ehcache 2lc. -->
|
||||||
<!-- <bundle>wrap:mvn:net.sf.ehcache/ehcache-core/2.4.3</bundle> -->
|
<!-- <bundle>wrap:mvn:net.sf.ehcache/ehcache-core/2.4.3</bundle> -->
|
||||||
|
|
||||||
<bundle>mvn:com.fasterxml/classmate/0.8.0</bundle>
|
<bundle>mvn:com.fasterxml/classmate/0.8.0</bundle>
|
||||||
<bundle>mvn:org.jboss.logging/jboss-logging/3.1.0.GA</bundle>
|
<bundle>mvn:org.apache.logging.log4j/log4j-api/2.0</bundle>
|
||||||
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
|
<bundle>mvn:log4j/log4j/1.2.17</bundle>
|
||||||
|
<bundle>mvn:org.jboss.logging/jboss-logging/3.2.1.Final</bundle>
|
||||||
|
<bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate.common/hibernate-commons-annotations/4.0.3.Final</bundle>
|
<bundle>mvn:org.hibernate.common/hibernate-commons-annotations/4.0.5.Final</bundle>
|
||||||
|
|
||||||
<!-- JACC is optional. -->
|
<!-- JACC is optional. -->
|
||||||
<!--<bundle>mvn:javax.servlet/javax.servlet-api/3.0.1</bundle>
|
<!--<bundle>mvn:javax.servlet/javax.servlet-api/3.0.1</bundle>
|
||||||
<bundle>mvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec/1.0.2.Final</bundle>-->
|
<bundle>mvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec/1.0.2.Final</bundle>-->
|
||||||
|
|
||||||
<!-- hibernate-validator is optional. -->
|
<!-- hibernate-validator is optional. -->
|
||||||
<!--<bundle>wrap:mvn:javax.validation/validation-api/1.0.0.GA</bundle>
|
<!--<bundle>wrap:mvn:javax.validation/validation-api/1.0.0.GA</bundle>
|
||||||
<bundle>mvn:org.hibernate/hibernate-validator/4.2.0.Final</bundle>-->
|
<bundle>mvn:org.hibernate/hibernate-validator/4.2.0.Final</bundle>-->
|
||||||
|
|
||||||
<!-- Optional. Needed to test infinispan 2lc. -->
|
<!-- Optional. Needed to test infinispan 2lc. -->
|
||||||
<!-- IMPORTANT: Infinispan requires the JRE sun.misc package. You
|
<!-- IMPORTANT: Infinispan requires the JRE sun.misc package. You
|
||||||
MUST enable this in your OSGi container. For Karaf, add
|
MUST enable this in your OSGi container. For Karaf, add
|
||||||
"org.osgi.framework.system.packages.extra=sun.misc" to etc/config.properties -->
|
"org.osgi.framework.system.packages.extra=sun.misc" to etc/config.properties -->
|
||||||
<!-- <bundle>wrap:mvn:org.jboss.marshalling/jboss-marshalling/1.3.17.GA</bundle>
|
<!-- <bundle>wrap:mvn:org.jboss.marshalling/jboss-marshalling/1.3.17.GA</bundle>
|
||||||
<bundle>wrap:mvn:org.jboss.marshalling/jboss-marshalling-river/1.3.17.GA</bundle>
|
<bundle>wrap:mvn:org.jboss.marshalling/jboss-marshalling-river/1.3.17.GA</bundle>
|
||||||
<bundle>wrap:mvn:org.jboss/staxmapper/1.1.0.Final</bundle>
|
<bundle>wrap:mvn:org.jboss/staxmapper/1.1.0.Final</bundle>
|
||||||
<bundle>mvn:org.jgroups/jgroups/3.2.8.Final</bundle>
|
<bundle>mvn:org.jgroups/jgroups/3.2.8.Final</bundle>
|
||||||
<bundle>mvn:org.infinispan/infinispan-core/5.2.0.Beta3</bundle> -->
|
<bundle>mvn:org.infinispan/infinispan-core/5.2.0.Beta3</bundle> -->
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate/hibernate-core/4.3.0-SNAPSHOT</bundle>
|
<bundle>mvn:org.hibernate/hibernate-core/5.0.0-SNAPSHOT</bundle>
|
||||||
<!-- TODO: Shouldn't need this, but hibernate-osgi's activator is a catch-all for SF and EMF. -->
|
<!-- TODO: Shouldn't need this, but hibernate-osgi's activator is a catch-all for SF and EMF. -->
|
||||||
<bundle>mvn:org.hibernate/hibernate-entitymanager/4.3.0-SNAPSHOT</bundle>
|
<bundle>mvn:org.hibernate/hibernate-entitymanager/5.0.0-SNAPSHOT</bundle>
|
||||||
<bundle>mvn:org.hibernate/hibernate-envers/4.3.0-SNAPSHOT</bundle>
|
<bundle>mvn:org.hibernate/hibernate-envers/5.0.0-SNAPSHOT</bundle>
|
||||||
<!-- <bundle>mvn:org.hibernate/hibernate-c3p0/4.3.0-SNAPSHOT</bundle> -->
|
<!-- <bundle>mvn:org.hibernate/hibernate-c3p0/5.0.0-SNAPSHOT</bundle> -->
|
||||||
<!-- <bundle>mvn:org.hibernate/hibernate-proxool/4.3.0-SNAPSHOT</bundle> -->
|
<!-- <bundle>mvn:org.hibernate/hibernate-proxool/5.0.0-SNAPSHOT</bundle> -->
|
||||||
<!-- <bundle>mvn:org.hibernate/hibernate-ehcache/4.3.0-SNAPSHOT</bundle> -->
|
<!-- <bundle>mvn:org.hibernate/hibernate-ehcache/5.0.0-SNAPSHOT</bundle> -->
|
||||||
<!-- <bundle>mvn:org.hibernate/hibernate-infinispan/4.3.0-SNAPSHOT</bundle> -->
|
<!-- <bundle>mvn:org.hibernate/hibernate-infinispan/5.0.0-SNAPSHOT</bundle> -->
|
||||||
<bundle>mvn:org.hibernate/hibernate-osgi/4.3.0-SNAPSHOT</bundle>
|
<bundle>mvn:org.hibernate/hibernate-osgi/5.0.0-SNAPSHOT</bundle>
|
||||||
|
|
||||||
<bundle>mvn:org.hibernate.osgi/unmanaged-native/1.0.0</bundle>
|
<bundle>mvn:org.hibernate.osgi/unmanaged-native/1.0.0</bundle>
|
||||||
</feature>
|
</feature>
|
||||||
</features>
|
</features>
|
||||||
|
|
|
@ -1,83 +1,83 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.hibernate.osgi</groupId>
|
<groupId>org.hibernate.osgi</groupId>
|
||||||
<artifactId>unmanaged-native</artifactId>
|
<artifactId>unmanaged-native</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<packaging>bundle</packaging>
|
<packaging>bundle</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate.javax.persistence</groupId>
|
<groupId>org.hibernate.javax.persistence</groupId>
|
||||||
<artifactId>hibernate-jpa-2.1-api</artifactId>
|
<artifactId>hibernate-jpa-2.1-api</artifactId>
|
||||||
<version>1.0.0.Final</version>
|
<version>1.0.0.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.osgi</groupId>
|
<groupId>org.osgi</groupId>
|
||||||
<artifactId>org.osgi.core</artifactId>
|
<artifactId>org.osgi.core</artifactId>
|
||||||
<version>4.3.1</version>
|
<version>4.3.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.osgi</groupId>
|
<groupId>org.osgi</groupId>
|
||||||
<artifactId>org.osgi.enterprise</artifactId>
|
<artifactId>org.osgi.enterprise</artifactId>
|
||||||
<version>4.2.0</version>
|
<version>4.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.karaf.shell</groupId>
|
<groupId>org.apache.karaf.shell</groupId>
|
||||||
<artifactId>org.apache.karaf.shell.console</artifactId>
|
<artifactId>org.apache.karaf.shell.console</artifactId>
|
||||||
<version>2.3.0</version>
|
<version>2.3.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-core</artifactId>
|
<artifactId>hibernate-core</artifactId>
|
||||||
<version>4.3.0-SNAPSHOT</version>
|
<version>5.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate</groupId>
|
<groupId>org.hibernate</groupId>
|
||||||
<artifactId>hibernate-envers</artifactId>
|
<artifactId>hibernate-envers</artifactId>
|
||||||
<version>4.3.0-SNAPSHOT</version>
|
<version>5.0.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
<version>1.3.170</version>
|
<version>1.3.170</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.felix</groupId>
|
<groupId>org.apache.felix</groupId>
|
||||||
<artifactId>maven-bundle-plugin</artifactId>
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<instructions>
|
<instructions>
|
||||||
<Bundle-SymbolicName>org.hibernate.osgi.unmanaged-native</Bundle-SymbolicName>
|
<Bundle-SymbolicName>org.hibernate.osgi.unmanaged-native</Bundle-SymbolicName>
|
||||||
<Bundle-Name>unmanaged-native</Bundle-Name>
|
<Bundle-Name>unmanaged-native</Bundle-Name>
|
||||||
<Bundle-Version>1.0.0</Bundle-Version>
|
<Bundle-Version>1.0.0</Bundle-Version>
|
||||||
<Export-Package>
|
<Export-Package>
|
||||||
org.hibernate.osgitest,
|
org.hibernate.osgitest,
|
||||||
org.hibernate.osgitest.entity
|
org.hibernate.osgitest.entity
|
||||||
</Export-Package>
|
</Export-Package>
|
||||||
<Import-Package>
|
<Import-Package>
|
||||||
org.apache.felix.service.command,
|
org.apache.felix.service.command,
|
||||||
org.apache.felix.gogo.commands,
|
org.apache.felix.gogo.commands,
|
||||||
org.apache.karaf.shell.console,
|
org.apache.karaf.shell.console,
|
||||||
org.apache.karaf.shell.commands,
|
org.apache.karaf.shell.commands,
|
||||||
org.h2,
|
org.h2,
|
||||||
org.hibernate,
|
org.hibernate,
|
||||||
org.hibernate.cfg,
|
org.hibernate.cfg,
|
||||||
org.hibernate.service,
|
org.hibernate.service,
|
||||||
javax.persistence;version="[1.0.0,2.1.0]",
|
javax.persistence;version="[1.0.0,2.1.0]",
|
||||||
<!-- Needed for proxying's Javassist enhancement during runtime -->
|
<!-- Needed for proxying's Javassist enhancement during runtime -->
|
||||||
org.hibernate.proxy,
|
org.hibernate.proxy,
|
||||||
javassist.util.proxy,
|
javassist.util.proxy,
|
||||||
*
|
*
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
</instructions>
|
</instructions>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -20,11 +20,6 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.osgitest;
|
package org.hibernate.osgitest;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.hibernate.Hibernate;
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.hibernate.envers.AuditReader;
|
import org.hibernate.envers.AuditReader;
|
||||||
|
@ -32,6 +27,10 @@ import org.hibernate.envers.AuditReaderFactory;
|
||||||
import org.hibernate.envers.DefaultRevisionEntity;
|
import org.hibernate.envers.DefaultRevisionEntity;
|
||||||
import org.hibernate.osgitest.entity.DataPoint;
|
import org.hibernate.osgitest.entity.DataPoint;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brett Meyer
|
* @author Brett Meyer
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,10 +20,9 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.osgitest;
|
package org.hibernate.osgitest;
|
||||||
|
|
||||||
import org.hibernate.cfg.Configuration;
|
import org.hibernate.boot.Metadata;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.integrator.spi.Integrator;
|
import org.hibernate.integrator.spi.Integrator;
|
||||||
import org.hibernate.metamodel.source.MetadataImplementor;
|
|
||||||
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,16 +31,15 @@ import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
||||||
*/
|
*/
|
||||||
public class TestIntegrator implements Integrator {
|
public class TestIntegrator implements Integrator {
|
||||||
|
|
||||||
public void integrate(Configuration configuration, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
public void integrate(
|
||||||
System.out.println("Integrator#integrate");
|
Metadata metadata,
|
||||||
}
|
SessionFactoryImplementor sessionFactory,
|
||||||
|
SessionFactoryServiceRegistry serviceRegistry) {
|
||||||
|
System.out.println("Integrator#integrate");
|
||||||
|
}
|
||||||
|
|
||||||
public void integrate(MetadataImplementor metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
||||||
System.out.println("Integrator#integrate");
|
System.out.println("Integrator#disintegrate");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
|
|
||||||
System.out.println("Integrator#disintegrate");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.osgitest;
|
package org.hibernate.osgitest;
|
||||||
|
|
||||||
import org.hibernate.metamodel.spi.TypeContributions;
|
import org.hibernate.boot.model.TypeContributions;
|
||||||
import org.hibernate.metamodel.spi.TypeContributor;
|
import org.hibernate.boot.model.TypeContributor;
|
||||||
import org.hibernate.service.ServiceRegistry;
|
import org.hibernate.service.ServiceRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,12 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<blueprint default-activation="eager"
|
<blueprint default-activation="eager"
|
||||||
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
|
||||||
<bean id="dpService" class="org.hibernate.osgitest.DataPointServiceImpl"/>
|
<bean id="dpService" class="org.hibernate.osgitest.DataPointServiceImpl"/>
|
||||||
<service ref="dpService" interface="org.hibernate.osgitest.DataPointService" />
|
<service ref="dpService" interface="org.hibernate.osgitest.DataPointService"/>
|
||||||
|
|
||||||
<!-- This demonstrates how to register your custom implementations of Hibernate extension points. -->
|
<!-- This demonstrates how to register your custom implementations of Hibernate extension points. -->
|
||||||
|
|
||||||
|
@ -30,47 +30,48 @@
|
||||||
<service ref="integrator" interface="org.hibernate.integrator.spi.Integrator"/>
|
<service ref="integrator" interface="org.hibernate.integrator.spi.Integrator"/>
|
||||||
|
|
||||||
<bean id="strategyRegistrationProvider" class="org.hibernate.osgitest.TestStrategyRegistrationProvider"/>
|
<bean id="strategyRegistrationProvider" class="org.hibernate.osgitest.TestStrategyRegistrationProvider"/>
|
||||||
<service ref="strategyRegistrationProvider" interface="org.hibernate.boot.registry.selector.StrategyRegistrationProvider"/>
|
<service ref="strategyRegistrationProvider"
|
||||||
|
interface="org.hibernate.boot.registry.selector.StrategyRegistrationProvider"/>
|
||||||
|
|
||||||
<bean id="typeContributor" class="org.hibernate.osgitest.TestTypeContributor"/>
|
<bean id="typeContributor" class="org.hibernate.osgitest.TestTypeContributor"/>
|
||||||
<service ref="typeContributor" interface="org.hibernate.boot.model.TypeContributor"/>
|
<service ref="typeContributor" interface="org.hibernate.boot.model.TypeContributor"/>
|
||||||
|
|
||||||
<!-- This bundle makes use of Karaf commands to demonstrate core persistence operations. Feel free to remove it. -->
|
<!-- This bundle makes use of Karaf commands to demonstrate core persistence operations. Feel free to remove it. -->
|
||||||
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
|
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
|
||||||
<command name="dp:add">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.AddCommand">
|
<action class="org.hibernate.osgitest.command.AddCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:update">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.UpdateCommand">
|
<action class="org.hibernate.osgitest.command.UpdateCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:get">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.GetCommand">
|
<action class="org.hibernate.osgitest.command.GetCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:load">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.LoadCommand">
|
<action class="org.hibernate.osgitest.command.LoadCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:getAll">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.GetAllCommand">
|
<action class="org.hibernate.osgitest.command.GetAllCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:getRevisions">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.GetRevisionsCommand">
|
<action class="org.hibernate.osgitest.command.GetRevisionsCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
<command name="dp:deleteAll">
|
<command>
|
||||||
<action class="org.hibernate.osgitest.command.DeleteAllCommand">
|
<action class="org.hibernate.osgitest.command.DeleteAllCommand">
|
||||||
<property name="dpService" ref="dpService"/>
|
<property name="dpService" ref="dpService"/>
|
||||||
</action>
|
</action>
|
||||||
</command>
|
</command>
|
||||||
</command-bundle>
|
</command-bundle>
|
||||||
</blueprint>
|
</blueprint>
|
||||||
|
|
|
@ -23,16 +23,9 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.model.source.internal.annotations;
|
package org.hibernate.boot.model.source.internal.annotations;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import org.dom4j.Document;
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import javax.persistence.AttributeConverter;
|
|
||||||
import javax.persistence.Converter;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
|
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
|
import org.hibernate.annotations.common.reflection.ClassLoadingException;
|
||||||
import org.hibernate.annotations.common.reflection.MetadataProviderInjector;
|
import org.hibernate.annotations.common.reflection.MetadataProviderInjector;
|
||||||
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
|
@ -50,11 +43,17 @@ import org.hibernate.cfg.annotations.reflection.AttributeConverterDefinitionColl
|
||||||
import org.hibernate.cfg.annotations.reflection.JPAMetadataProvider;
|
import org.hibernate.cfg.annotations.reflection.JPAMetadataProvider;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
|
|
||||||
import org.jboss.jandex.IndexView;
|
import org.jboss.jandex.IndexView;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.dom4j.Document;
|
import javax.persistence.AttributeConverter;
|
||||||
|
import javax.persistence.Converter;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
|
@ -143,9 +142,9 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private XClass toXClass(String className, ReflectionManager reflectionManager) {
|
private XClass toXClass(String className, ReflectionManager reflectionManager) {
|
||||||
try {
|
try {
|
||||||
return reflectionManager.classForName( className, this.getClass() );
|
return reflectionManager.classForName( className );
|
||||||
}
|
}
|
||||||
catch ( ClassNotFoundException e ) {
|
catch ( ClassLoadingException e ) {
|
||||||
throw new AnnotationException( "Unable to load class defined in XML: " + className, e );
|
throw new AnnotationException( "Unable to load class defined in XML: " + className, e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,17 +23,6 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cfg;
|
package org.hibernate.cfg;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.StringTokenizer;
|
|
||||||
|
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
|
@ -41,6 +30,7 @@ import org.hibernate.annotations.AnyMetaDef;
|
||||||
import org.hibernate.annotations.AnyMetaDefs;
|
import org.hibernate.annotations.AnyMetaDefs;
|
||||||
import org.hibernate.annotations.MetaValue;
|
import org.hibernate.annotations.MetaValue;
|
||||||
import org.hibernate.annotations.SqlFragmentAlias;
|
import org.hibernate.annotations.SqlFragmentAlias;
|
||||||
|
import org.hibernate.annotations.common.reflection.ClassLoadingException;
|
||||||
import org.hibernate.annotations.common.reflection.XAnnotatedElement;
|
import org.hibernate.annotations.common.reflection.XAnnotatedElement;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
import org.hibernate.annotations.common.reflection.XPackage;
|
import org.hibernate.annotations.common.reflection.XPackage;
|
||||||
|
@ -66,9 +56,19 @@ import org.hibernate.mapping.SyntheticProperty;
|
||||||
import org.hibernate.mapping.Table;
|
import org.hibernate.mapping.Table;
|
||||||
import org.hibernate.mapping.ToOne;
|
import org.hibernate.mapping.ToOne;
|
||||||
import org.hibernate.mapping.Value;
|
import org.hibernate.mapping.Value;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
|
@ -859,9 +859,9 @@ public class BinderHelper {
|
||||||
final XClass persistentXClass;
|
final XClass persistentXClass;
|
||||||
try {
|
try {
|
||||||
persistentXClass = buildingContext.getBuildingOptions().getReflectionManager()
|
persistentXClass = buildingContext.getBuildingOptions().getReflectionManager()
|
||||||
.classForName( propertyHolder.getPersistentClass().getClassName(), AnnotationBinder.class );
|
.classForName( propertyHolder.getPersistentClass().getClassName() );
|
||||||
}
|
}
|
||||||
catch ( ClassNotFoundException e ) {
|
catch ( ClassLoadingException e ) {
|
||||||
throw new AssertionFailure( "PersistentClass name cannot be converted into a Class", e);
|
throw new AssertionFailure( "PersistentClass name cannot be converted into a Class", e);
|
||||||
}
|
}
|
||||||
if ( propertyHolder.isInIdClass() ) {
|
if ( propertyHolder.isInIdClass() ) {
|
||||||
|
|
|
@ -23,19 +23,12 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cfg.annotations;
|
package org.hibernate.cfg.annotations;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Random;
|
|
||||||
import javax.persistence.AttributeOverride;
|
|
||||||
import javax.persistence.AttributeOverrides;
|
|
||||||
import javax.persistence.MapKeyClass;
|
|
||||||
|
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.FetchMode;
|
import org.hibernate.FetchMode;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.annotations.MapKeyType;
|
import org.hibernate.annotations.MapKeyType;
|
||||||
|
import org.hibernate.annotations.common.reflection.ClassLoadingException;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
import org.hibernate.annotations.common.reflection.XProperty;
|
import org.hibernate.annotations.common.reflection.XProperty;
|
||||||
import org.hibernate.boot.spi.MetadataBuildingContext;
|
import org.hibernate.boot.spi.MetadataBuildingContext;
|
||||||
|
@ -68,6 +61,14 @@ import org.hibernate.mapping.ToOne;
|
||||||
import org.hibernate.mapping.Value;
|
import org.hibernate.mapping.Value;
|
||||||
import org.hibernate.sql.Template;
|
import org.hibernate.sql.Template;
|
||||||
|
|
||||||
|
import javax.persistence.AttributeOverride;
|
||||||
|
import javax.persistence.AttributeOverrides;
|
||||||
|
import javax.persistence.MapKeyClass;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation to bind a Map
|
* Implementation to bind a Map
|
||||||
*
|
*
|
||||||
|
@ -185,9 +186,9 @@ public class MapBinder extends CollectionBinder {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
try {
|
try {
|
||||||
keyXClass = buildingContext.getBuildingOptions().getReflectionManager().classForName( mapKeyType, MapBinder.class );
|
keyXClass = buildingContext.getBuildingOptions().getReflectionManager().classForName( mapKeyType );
|
||||||
}
|
}
|
||||||
catch (ClassNotFoundException e) {
|
catch (ClassLoadingException e) {
|
||||||
throw new AnnotationException( "Unable to find class: " + mapKeyType, e );
|
throw new AnnotationException( "Unable to find class: " + mapKeyType, e );
|
||||||
}
|
}
|
||||||
classType = buildingContext.getMetadataCollector().getClassType( keyXClass );
|
classType = buildingContext.getMetadataCollector().getClassType( keyXClass );
|
||||||
|
|
|
@ -23,27 +23,27 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.jpa.event.internal.jpa;
|
package org.hibernate.jpa.event.internal.jpa;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
import org.hibernate.MappingException;
|
||||||
import java.lang.annotation.ElementType;
|
import org.hibernate.annotations.common.reflection.ClassLoadingException;
|
||||||
import java.lang.annotation.Target;
|
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
||||||
import java.lang.reflect.Method;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
import java.util.ArrayList;
|
import org.hibernate.annotations.common.reflection.XMethod;
|
||||||
import java.util.List;
|
import org.hibernate.jpa.event.spi.jpa.Callback;
|
||||||
|
import org.hibernate.jpa.event.spi.jpa.ListenerFactory;
|
||||||
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.EntityListeners;
|
import javax.persistence.EntityListeners;
|
||||||
import javax.persistence.ExcludeDefaultListeners;
|
import javax.persistence.ExcludeDefaultListeners;
|
||||||
import javax.persistence.ExcludeSuperclassListeners;
|
import javax.persistence.ExcludeSuperclassListeners;
|
||||||
import javax.persistence.MappedSuperclass;
|
import javax.persistence.MappedSuperclass;
|
||||||
import javax.persistence.PersistenceException;
|
import javax.persistence.PersistenceException;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
import org.hibernate.MappingException;
|
import java.lang.annotation.ElementType;
|
||||||
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
import java.lang.annotation.Target;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import java.lang.reflect.Method;
|
||||||
import org.hibernate.annotations.common.reflection.XMethod;
|
import java.util.ArrayList;
|
||||||
import org.hibernate.jpa.event.spi.jpa.Callback;
|
import java.util.List;
|
||||||
import org.hibernate.jpa.event.spi.jpa.ListenerFactory;
|
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
|
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
|
||||||
|
@ -64,14 +64,14 @@ public class LegacyCallbackProcessor implements CallbackProcessor {
|
||||||
public void processCallbacksForEntity(Object entityObject, CallbackRegistryImpl callbackRegistry) {
|
public void processCallbacksForEntity(Object entityObject, CallbackRegistryImpl callbackRegistry) {
|
||||||
final String entityClassName = (String) entityObject;
|
final String entityClassName = (String) entityObject;
|
||||||
try {
|
try {
|
||||||
final XClass entityXClass = reflectionManager.classForName( entityClassName, this.getClass() );
|
final XClass entityXClass = reflectionManager.classForName( entityClassName );
|
||||||
final Class entityClass = reflectionManager.toClass( entityXClass );
|
final Class entityClass = reflectionManager.toClass( entityXClass );
|
||||||
for ( Class annotationClass : CALLBACK_ANNOTATION_CLASSES ) {
|
for ( Class annotationClass : CALLBACK_ANNOTATION_CLASSES ) {
|
||||||
final Callback[] callbacks = resolveCallbacks( entityXClass, annotationClass, reflectionManager );
|
final Callback[] callbacks = resolveCallbacks( entityXClass, annotationClass, reflectionManager );
|
||||||
callbackRegistry.addEntityCallbacks( entityClass, annotationClass, callbacks );
|
callbackRegistry.addEntityCallbacks( entityClass, annotationClass, callbacks );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (ClassNotFoundException e) {
|
catch (ClassLoadingException e) {
|
||||||
throw new MappingException( "entity class not found: " + entityClassName, e );
|
throw new MappingException( "entity class not found: " + entityClassName, e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ package org.hibernate.envers.configuration.internal;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
|
import org.hibernate.annotations.common.reflection.ClassLoadingException;
|
||||||
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
import org.hibernate.annotations.common.reflection.XProperty;
|
import org.hibernate.annotations.common.reflection.XProperty;
|
||||||
|
@ -319,9 +320,9 @@ public class RevisionInfoConfiguration {
|
||||||
if (persistentClass.getClassName() != null) {
|
if (persistentClass.getClassName() != null) {
|
||||||
XClass clazz;
|
XClass clazz;
|
||||||
try {
|
try {
|
||||||
clazz = reflectionManager.classForName( persistentClass.getClassName(), this.getClass() );
|
clazz = reflectionManager.classForName( persistentClass.getClassName() );
|
||||||
}
|
}
|
||||||
catch (ClassNotFoundException e) {
|
catch (ClassLoadingException e) {
|
||||||
throw new MappingException( e );
|
throw new MappingException( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.envers.configuration.internal.metadata.reader;
|
package org.hibernate.envers.configuration.internal.metadata.reader;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
|
import org.hibernate.annotations.common.reflection.ClassLoadingException;
|
||||||
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
import org.hibernate.envers.AuditTable;
|
import org.hibernate.envers.AuditTable;
|
||||||
|
@ -38,6 +36,9 @@ import org.hibernate.envers.configuration.internal.GlobalConfiguration;
|
||||||
import org.hibernate.mapping.PersistentClass;
|
import org.hibernate.mapping.PersistentClass;
|
||||||
import org.hibernate.mapping.Property;
|
import org.hibernate.mapping.Property;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A helper class to read versioning meta-data from annotations on a persistent class.
|
* A helper class to read versioning meta-data from annotations on a persistent class.
|
||||||
*
|
*
|
||||||
|
@ -113,7 +114,7 @@ public final class AnnotationsMetadataReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final XClass xclass = reflectionManager.classForName( pc.getClassName(), this.getClass() );
|
final XClass xclass = reflectionManager.classForName( pc.getClassName() );
|
||||||
|
|
||||||
final ModificationStore defaultStore = getDefaultAudited( xclass );
|
final ModificationStore defaultStore = getDefaultAudited( xclass );
|
||||||
if ( defaultStore != null ) {
|
if ( defaultStore != null ) {
|
||||||
|
@ -132,7 +133,7 @@ public final class AnnotationsMetadataReader {
|
||||||
addAuditTable( xclass );
|
addAuditTable( xclass );
|
||||||
addAuditSecondaryTables( xclass );
|
addAuditSecondaryTables( xclass );
|
||||||
}
|
}
|
||||||
catch (ClassNotFoundException e) {
|
catch (ClassLoadingException e) {
|
||||||
throw new MappingException( e );
|
throw new MappingException( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,19 +23,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.envers.configuration.internal.metadata.reader;
|
package org.hibernate.envers.configuration.internal.metadata.reader;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.MapKey;
|
|
||||||
import javax.persistence.OneToMany;
|
|
||||||
import javax.persistence.Version;
|
|
||||||
|
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
|
import org.hibernate.annotations.common.reflection.ClassLoadingException;
|
||||||
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
import org.hibernate.annotations.common.reflection.ReflectionManager;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
import org.hibernate.annotations.common.reflection.XProperty;
|
import org.hibernate.annotations.common.reflection.XProperty;
|
||||||
|
@ -57,6 +46,18 @@ import org.hibernate.mapping.Component;
|
||||||
import org.hibernate.mapping.Property;
|
import org.hibernate.mapping.Property;
|
||||||
import org.hibernate.mapping.Value;
|
import org.hibernate.mapping.Value;
|
||||||
|
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.MapKey;
|
||||||
|
import javax.persistence.OneToMany;
|
||||||
|
import javax.persistence.Version;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import static org.hibernate.envers.internal.tools.Tools.newHashMap;
|
import static org.hibernate.envers.internal.tools.Tools.newHashMap;
|
||||||
import static org.hibernate.envers.internal.tools.Tools.newHashSet;
|
import static org.hibernate.envers.internal.tools.Tools.newHashSet;
|
||||||
|
|
||||||
|
@ -732,9 +733,9 @@ public class AuditedPropertiesReader {
|
||||||
|
|
||||||
public ComponentPropertiesSource(ReflectionManager reflectionManager, Component component) {
|
public ComponentPropertiesSource(ReflectionManager reflectionManager, Component component) {
|
||||||
try {
|
try {
|
||||||
this.xclass = reflectionManager.classForName( component.getComponentClassName(), this.getClass() );
|
this.xclass = reflectionManager.classForName( component.getComponentClassName() );
|
||||||
}
|
}
|
||||||
catch ( ClassNotFoundException e ) {
|
catch ( ClassLoadingException e ) {
|
||||||
throw new MappingException( e );
|
throw new MappingException( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,10 @@
|
||||||
<bean id="typeContributor" class="org.hibernate.envers.boot.internal.TypeContributorImpl"/>
|
<bean id="typeContributor" class="org.hibernate.envers.boot.internal.TypeContributorImpl"/>
|
||||||
<service ref="typeContributor" interface="org.hibernate.boot.model.TypeContributor"/>
|
<service ref="typeContributor" interface="org.hibernate.boot.model.TypeContributor"/>
|
||||||
|
|
||||||
|
<bean id="serviceContributor" class="org.hibernate.envers.boot.internal.EnversServiceContributor"/>
|
||||||
|
<service ref="serviceContributor" interface="org.hibernate.service.spi.ServiceContributor"/>
|
||||||
|
|
||||||
|
<bean id="additionalJaxbMappingProducer" class="org.hibernate.envers.boot.internal.AdditionalJaxbMappingProducerImpl"/>
|
||||||
|
<service ref="additionalJaxbMappingProducer" interface="org.hibernate.boot.spi.AdditionalJaxbMappingProducer"/>
|
||||||
|
|
||||||
</blueprint>
|
</blueprint>
|
||||||
|
|
Loading…
Reference in New Issue