我坚持使用osgi envers支持在我的捆绑中集成。我正在使用hibernate-core和hibernate dataset activate D1.
sort cases by name.
match files /file=* /tab=D2/by name/drop rname.
exe.
,如何在蓝图中实现它?
我有@Audited注释和导入envers 4.2.22 redhat version
的实体。
我想使用审核和修订。
答案 0 :(得分:1)
See Chapter 17.7 of the hibernate docs
您将envers扩展名注册为OSGi服务。
<blueprint default-activation="eager">
<bean id="integrator" class="org.hibernate.envers.event.spi.EnversIntegrator" />
<service ref="integrator" interface="org.hibernate.integrator.spi.Integrator" />
</blueprint>
答案 1 :(得分:1)
在注册的envers扩展服务之后,我的清单中导入了所需的envers支持包。 应通过Embed依赖方法导入所需的包。使用Include-Resource标记包含hibernate资源,并确保添加Bundle-Classpath以定义envers依赖项。现在它在基于JBoss fuse karaf的OSGi容器中运行良好,然后成功创建了revinfo和_aud表。
这是我的清单,
Manifest-Version: 1.0
Bnd-LastModified: 1481971039345
Build-Jdk: 1.8.0_112
Built-By: Smile
Bundle-Activator: com.fuse.hibernate.services.OsgiBundleActiva
tor
Bundle-Blueprint: OSGI-INF/blueprint/blueprint.xml
Bundle-ClassPath: .,hibernate-envers-4.2.22.Final-redhat-1.jar
Bundle-ManifestVersion: 2
Bundle-Name: FUSE-HIBERNATE
Bundle-SymbolicName: fuse-hibernate
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: <Exported Packages>
Export-Service: com.fuse.repository.CustomRepository
Import-Package: org.hibernate.annotations;version="[4.2,5)",org.hibernat
e.annotations.common.reflection;version="[4.0,5)",javax.persistence;ver
sion="[2.0,3)",org.hibernate.proxy;version="[4.2,5)",javassist.util.pro
xy;version="[3.18,4)",org.slf4j;version="[1.7,2)",javax.management,java
x.naming,javax.persistence.metamodel;version="[2.0,3)",javax.transactio
n;version="[1.1,2)",org.apache.commons.beanutils;version="[1.8,2)",org.
apache.commons.lang3;version="[3.0,4)",org.apache.tools.ant,org.dom4j,o
rg.dom4j.io,org.dom4j.tree,org.hibernate;version="[4.2,5)",org.hibernat
e.action.spi;version="[4.2,5)",org.hibernate.cache;version="[4.2,5)",or
g.hibernate.cfg;version="[4.2,5)",org.hibernate.collection.spi;version=
"[4.2,5)",org.hibernate.criterion;version="[4.2,5)",org.hibernate.diale
ct;version="[4.2,5)",org.hibernate.engine.jdbc.spi;version="[4.2,5)",or
g.hibernate.engine.loading.internal,org.hibernate.engine.spi;version="[
4.2,5)",org.hibernate.engine.transaction.spi;version="[4.2,5)",org.hibe
rnate.event.service.spi;version="[4.2,5)",org.hibernate.event.spi;versi
on="[4.2,5)",org.hibernate.id;version="[4.2,5)",org.hibernate.id.enhanc
ed;version="[4.2,5)",org.hibernate.integrator.spi;version="[4.2,5)",org
.hibernate.internal,org.hibernate.internal.util;version="[4.2,5)",org.h
ibernate.internal.util.collections,org.hibernate.internal.util.config,o
rg.hibernate.internal.util.xml,org.hibernate.jdbc;version="[4.2,5)",org
.hibernate.mapping;version="[4.2,5)",org.hibernate.metamodel.source;ver
sion="[4.2,5)",org.hibernate.metamodel.spi;version="[4.2,5)",org.hibern
ate.persister.collection;version="[4.2,5)",org.hibernate.persister.enti
ty;version="[4.2,5)",org.hibernate.property;version="[4.2,5)",org.hiber
nate.service;version="[4.2,5)",org.hibernate.service.classloading.spi;v
ersion="[4.2,5)",org.hibernate.service.jdbc.dialect.internal,org.hibern
ate.service.jndi;version="[4.2,5)",org.hibernate.service.spi;version="[
4.2,5)",org.hibernate.sql;version="[4.2,5)",org.hibernate.tool.hbm2ddl;
version="[4.2,5)",org.hibernate.type;version="[4.2,5)",org.hibernate.us
ertype;version="[4.2,5)",org.jboss.logging;version="[3.1,4)",org.joda.t
ime;version="[2.9,3)",org.osgi.framework;version="[1.6,2)",org.osgi.ser
vice.blueprint;version="[1.0.0,2.0.0)",org.w3c.dom,javax.sql
Meta-Persistence: META-INF/persistence.xml