hibernate-envers

Classloader Issues with Envers in OSGi

若如初见. 提交于 2019-12-11 04:14:54
问题 I've successfully started Hibernate in an OSGi context, and now I want to add Envers. The documentation claims that's possible. I don't believe it anymore. There is no documentation of any kind for this subject and nobody seems to have actually done it. Moreover even with a Blueprint implementation I had to hack the classloader to make Hibernate even find Envers: osgiClassLoader = new org.hibernate.osgi.OsgiClassLoader(); osgiClassLoader.addBundle(requestingBundle); osgiClassLoader.addBundle

Composite table with Hibernate Envers

一个人想着一个人 提交于 2019-12-11 02:52:46
问题 I have an application with a composite table holding one extra column. It all works fine, until we add Hibernate Envers (@Audited). org.hibernate.MappingException: Unable to read the mapped by attribute for responseDomainCodes in no.pack.response.ResponseDomainCode I am happy to provide more detailed information if necessary, however, at this time I am not sure what would be relevant. The tables look like this, and is a pretty standard composite key table, with one extra column. Database

Hibernate-envers throwing exception when Deleting entity with a collection using CrudRepository

北战南征 提交于 2019-12-11 02:45:53
问题 I would like to know if anyone else has used hibernate-envers with mysql in a Spring-boot application using the interface CrudRepository and has had trouble deleting entities with collections. I put together an example application with a test that demonstrates the exception that is generated. The example can be cloned from https://github.com/LindesRoets/test-delete.git You will need mysql running with a database called test_delete CREATE DATABASE IF NOT EXISTS `test_delete` DEFAULT CHARACTER

Can I make a particular transaction disable auditing using ENVERS?

匆匆过客 提交于 2019-12-10 23:09:03
问题 I am using hibernate in Spring.I also use ENVERS for auditing. I need to disable auditing for one particular transaction. Does ENVERS support this? 回答1: Yes, but it's certainly not very straight-forward. What you need to do is to implement conditional auditing, see documentation for details. The gist is that you'll need to present your own various Envers listener implementations which would fire and need to check some value you've set as a part of the transaction to veto the audit listener's

org.hibernate.MappingException: Type not supported ENVERs

妖精的绣舞 提交于 2019-12-10 15:44:46
问题 I just started getting this error when I introduced a composite primary key. Any ideal as to why? I have been unsuccessful in trying to figure this out. Caused by: org.hibernate.MappingException: Type not supported: org.hibernate.type.SerializableType at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addIdProperties(IdMetadataGenerator.java:71) at org.hibernate.envers.configuration.metadata.IdMetadataGenerator.addId(IdMetadataGenerator.java:107) at org.hibernate.envers

Can i use only one table for all hibernate envers auditing?

南笙酒味 提交于 2019-12-10 13:06:43
问题 i recently found the beautiful library that is called "hibernate envers", it's such a great and easy way to have an audit log, it solved one of my biggest problem while working on a play web-application. Now, i know that Envers use one table for each audited entity, and want to know if it is possible to have one table for every thing? (using a varchar to put all the data for example and put the entity model in a separate column) Thanks in advance. 回答1: No, that is not possible. Only table-per

How to prevent audit on insert using envers 4 hibernate

五迷三道 提交于 2019-12-10 12:25:29
问题 I am using Hibernate 4.0 with envers When I do an update or insert, data is getting saved into audit table with mode a 0 and 1 I would like to disable audit on post-insert. can someone please, let me know how to disable it. I have read that hibernate from version 4.0, it automatically registers the events for auditing. I there a way we can disable audit on insert? 回答1: hibernate.envers.autoRegisterListeners - controls whether the standard Envers listeners are auto-registered. You can register

Does HibernateTemplate work with Envers? If so, how?

半世苍凉 提交于 2019-12-10 11:29:51
问题 I am trying to use Envers on a project that also uses Hibernate and Spring - and I appreciate a lot the code reduction offered by HibernateTemplate. I configured Envers under JPA, and after a few tweaks I was able to have the schema generated by the EnversHibernateToolTask Ant task (including the auditing tables). However, when I write code such as: hibernateTemplate.saveOrUpdate(f); the data is persisted, but nothing goes to the auditing tables. Conversely, if I write: EntityManager em = emf

Diff on hibernate envers revisions

那年仲夏 提交于 2019-12-10 10:17:02
问题 This is a question related to: Hibernate Envers revision info (changes list) and Getting the old value and new value between two revisions with Hibernate Envers Since these questions are a few years old I would like to know if there has anything changed? Is it now possible to retrieve diffs with envers? Or do I still have to load two revisions and compare them by myself in Java? And if so - what's the best way to compare the two version in Java? Thanks. 回答1: I don't think anything's changed

stumbling blocks galore while trying to run org.hibernate.tool.ant.EnversHibernateToolTask

点点圈 提交于 2019-12-10 09:54:41
问题 I'm trying to run org.hibernate.tool.ant.EnversHibernateToolTask as suggested in the rather terse guide to Envers (2nd line of table, Documentation has a link to a PDF). Here's my ant task tweaked so it successfully finds org.hibernate.tool.ant.EnversHibernateToolTask and org.hibernate.tool.ant.HibernateToolTask; now it can't find org.apache.tools.ant.Task and I have the sinking feeling I am doing something wrong. <target name="schemaexport" depends="init" description="Exports a generated