Questions Tagged With hibernatehttps://answers.axonivy.com/tags/hibernate/?type=rss&user=Alexisquestions tagged <span class="tag">hibernate</span>enTue, 27 Jan 2015 17:05:26 -0500Adding additional Libraries to Hibernate, e.g. Envershttps://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envers<p>Hello Ivy-Developers!</p> <p>Envers is a powerfull Library, that comes along with the Hibernate-Package and allows auto-Auditing for entities. (History-Tables etc.)</p> <p>Update:</p> <p>To insert the library I did as following: Added hibernate-envers-4.2.13.Final.jar to ivy-Hibernate-jar:</p> <p>designer\plugins\ch.ivyteam.hibernate_5.1.0.201409121008.jar\lib\mvn\</p> <p>made some changes in the ivy-Hibernate-jar: ',lib/mvn/hibernate-envers-4.2.13.Final.jar' added to MANIFEST.MF</p> <p>in pom.xml I inserted a new dependency for hibernate-envers (see pom.xml)</p> <p>When inserting this library this unusual way, there are no more errors accessing the persistence.</p> <p>Adding @Audited to the Entity gives no error, but no auditing happens on merge.(Wich would usualy be the case)</p> <p>Merging through the EntityManager (from createEntityManager()) does not work (Nothing happens, no error)</p> <p>Trying to access the AuditReader will fail on a ClassNotFoundException: org.hibernate.envers.AuditReaderFactory</p> <pre><code>// switching contextClassLoader to ivy.request.getProject().getProjectClassLoader() EntityManager em = entityManager.createEntityManager(); AuditReaderFactory.get(em); </code></pre> <p>As I understand this has been successfully implemented in the csc project.</p> <p>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?</p> <p>Installation as described in: <a href="http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html/ch15.html">Guide from Hibernate</a> </p> <p>Thanks in advance!</p> <p>Greetings Alexis</p>AlexisTue, 27 Jan 2015 17:05:26 -0500https://answers.axonivy.com/questions/1138/adding-additional-libraries-to-hibernate-e-g-envershibernatepersistence