<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Adding additional Libraries to Hibernate, e.g. Envers</title><link>https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers</link><description>&lt;p&gt;Hello Ivy-Developers!&lt;/p&gt;
&lt;p&gt;Envers is a powerfull Library, that comes along with the Hibernate-Package and allows auto-Auditing for entities. (History-Tables etc.)&lt;/p&gt;
&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;To insert the library I did as following:
Added hibernate-envers-4.2.13.Final.jar to ivy-Hibernate-jar:&lt;/p&gt;
&lt;p&gt;designer\plugins\ch.ivyteam.hibernate_5.1.0.201409121008.jar\lib\mvn\&lt;/p&gt;
&lt;p&gt;made some changes in the ivy-Hibernate-jar:
',lib/mvn/hibernate-envers-4.2.13.Final.jar' added to MANIFEST.MF&lt;/p&gt;
&lt;p&gt;in pom.xml I inserted a new dependency for hibernate-envers (see pom.xml)&lt;/p&gt;
&lt;p&gt;When inserting this library this unusual way, there are no more errors accessing the persistence.&lt;/p&gt;
&lt;p&gt;Adding @Audited to the Entity gives no error, but no auditing happens on merge.(Wich would usualy be the case)&lt;/p&gt;
&lt;p&gt;Merging through the EntityManager (from createEntityManager()) does not work (Nothing happens, no error)&lt;/p&gt;
&lt;p&gt;Trying to access the AuditReader will fail on a ClassNotFoundException: org.hibernate.envers.AuditReaderFactory&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// switching contextClassLoader to ivy.request.getProject().getProjectClassLoader()
EntityManager em = entityManager.createEntityManager();
AuditReaderFactory.get(em);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As I understand this has been successfully implemented in the csc project.&lt;/p&gt;
&lt;p&gt;So the questions are: How can I integrate this library into Ivy? If not possible, is there a way to detach Hibernate more from Ivy?&lt;/p&gt;
&lt;p&gt;Installation as described in:
&lt;a href="http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html/ch15.html"&gt;Guide from Hibernate&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;
&lt;p&gt;Greetings 
Alexis&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 15 Feb 2017 14:30:34 -0500</lastBuildDate><item><title>Answer by SupportIvyTeam</title><link>https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers/2447</link><description>&lt;p&gt;Hi all,
with ivy 6.6 and later it will be much easier to use Hibernate Envers in an ivy Project (Thanks to Issue XIVY-1696).
An ivy sample project using Hibernate Envers can be found here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/ivy-pes/HibernateEnversSample"&gt;https://github.com/ivy-pes/HibernateEnversSample&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SupportIvyTeam</dc:creator><pubDate>Wed, 15 Feb 2017 14:30:34 -0500</pubDate><guid>https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers/2447</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers/1140</link><description>&lt;p&gt;In the designer: copy the additional library into &lt;strong&gt;jre/lib/ext&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the engine (server): copy it to &lt;strong&gt;lib/patch&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;on both products, restart is required in order to access the libraries.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Wed, 28 Jan 2015 10:27:32 -0500</pubDate><guid>https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers/1140</guid></item></channel></rss>