Questions tagged [hibernate-envers]

1

votes
0

answer
34

Views

Hibernate Envers how get entitie's revision with his associated object from the same revision

We are working with Hibernate Envers, with a Class A containing association with Class B. We get our object A from a certain revision number and we do it with success. But, seems like the associated object B is in his last revision and not sync with the Object A's revision historic... We are two ide...
Npr
1

votes
0

answer
38

Views

How to query with Hibernate Envers for chart data

I'm using Hibernate Envers and PostgreSQL to keep track of entity history and I'd like to take advantage of this to chart data for analytic purposes. For example, I'd like to campionate a count of entities during a certain period and I was able to produce a query to obtain this from Envers tables, i...
Giovanni Lovato
1

votes
1

answer
263

Views

How to prevent Hibernate Envers for creating Audit tables?

In my case, i have a dependency to a module that implementing envers in its domains (its domains were annotated with @Audited). When i imported that module in my pom.xml and run my app, envers automatically creating audit tables based on its domains. My question, how can i prevent Envers for creatin...
ary chandra
1

votes
0

answer
17

Views

Envers stopped auditing entity

I have ran into this issue: envers is not auditing anymore an entity that I have, although nothing changed. All versions for hibernate and envers are the same ( i checked earlier ), and the entity is still marked as audited. The table is created and has some values, now there are no more entries ad...
Bianca
1

votes
0

answer
54

Views

What is envers @AuditMappedBy() supposed to do?

I am using Hibernate-Envers 4.3.11 Final I see that the documentation says: To properly audit such relations with Envers, you can use the @AuditMappedBy annotation. It enables you to specify the reverse property (using the mappedBy element). In case of indexed collections, the index column must als...
Joey Corkey
1

votes
1

answer
2.1k

Views

Envers @OneToMany audit on CREATE(0) but not on DELETE(2)

I've looked a quite a few similar issues like: http://community.jboss.org/message/580407#580407 but haven't found a solution yet. An Activity has many Occurences, when an occurence is created the activity_occurence_AUD table is updated correctly with a 0 (create) revision. However when an occurance...
Ben
1

votes
1

answer
928

Views

Hibernate ENVERS Classloading issue

I am trying to integrate Hibernate Envers in an already developed application. I ship the Hibernate Envers JAR inside an EAR package, and it throws an ugly exception regarding to class loader and some kind of conflict. If I avoid shipping the Envers JAR inside the EAR and I place it in the 'lib' dir...
edutesoy
1

votes
1

answer
1.2k

Views

Java monitor changes in database - Hibernate and envers

I'm writing a server side application that will monitor changes to a database, I plan to do this with Hibernate. I'd like to set up a listener so that if any changes are made to the data any registered observers can be told there is an update and send a separate request to pull it. I've read about H...
PDStat
1

votes
1

answer
483

Views

select maximum value in inner query < another in an outer query

I have two auditing tables: Trip_aud and Event_aud. They were created in Envers, but I'm querying them with SQL. Their are basically the same as the domain tables, except for a revision value which is incremented every time there is a change and some tuple is inserted in an auditing table. When Tri...
Bruno Kim
1

votes
1

answer
368

Views

Envers audit entities

What is the better way to get list of audited entites? It is possible to use REVCHANGES table and look up all audited entytoes from this table but I belive that this is not best solution. Thanks, Volodymyr
user1459144
1

votes
1

answer
519

Views

JPA: Store last update time in a separate table

I am working with jpa and hibernate and i'm trying to store the creation/update/deletion time for each item managed by JPA. I need something like Hibernate Envers, but just store the last time, not all the revisions and I would like to store that data in a separate table (cause this data are not par...
lelmarir
1

votes
1

answer
451

Views

Can I use Hibernate Envers if I just want to keep deleted Entities around?

Right now we don't delete entities, but set a flag to 'inactive' in the table (and filter these entities out for normal operations). Someone pointed me to Hibernate Envers, but it looks a little bit like overkill to me. My questions are: Can we use Envers to perform our mechanism (active/inactive fl...
Landei
1

votes
1

answer
464

Views

Better approach to maintain audit of few entities

I have one Hibernate entity with following structure: @Entity public class A { private Integer id; private String name; @OneToMany private List bList; } @Entity public class B { private Integer id; @OneToMany private List cList; } Now I wants to maintain history on entity 'A', with information like...
Nirmal
1

votes
1

answer
525

Views

Storing previous versions with parent entity using nhibernate envers

I'm using nhibernate envers to audit my data / save previous versions. What I'd like to do is store previous versions against the parent entity. Something like this: public abstract class BookBase { public virtual int ID { get; set; } public virtual string Name { get; set; } public virtual string Au...
Alex
1

votes
2

answer
1.2k

Views

Envers not inserting records in version tables with JTA Atomikos

I am using Spring 3.1, Spring data jpa 1.2 with Hibernate 3.5.1 and envers 3.5.1. The issue is when using envers my _AUD table is getting created but the data is not inserted in the AUD tables. I have used @Audited on Person entity and created RevListener class implements RevisionListener. Also I h...
Gaurav
1

votes
2

answer
2.8k

Views

Querying Hibernate Envers revision by revision date

I have started using Hibernate Envers for audit logging business objects. I have read the documentation and from all the examples i have seen, querying is done by revision number. I would like to query by revision date, i.e. get all the rows of an audited entity the happened at a specific date or da...
Noam Nevo
1

votes
1

answer
2.1k

Views

Hibernate Envers: How to get revision from historical entity

I must be missing something obvious; however I am struggling to find an answer to a problem I am having with Hibernate Envers. Let's say that I have entity class called MyObject that is audited using envers. If I get the current copy of an instance of MyObject doing something like: Session session =...
subie
1

votes
1

answer
339

Views

Multiple Hibernate envers FirstLevelCache instances

I have been debugging some strange envers behaviour in my code for a couple of days and have stumbled on something that surprised me. I have confirmed that this is not contributing to my problem but I thought that it would be worth checking my assumptions anyway. If I get the current Hibernate sessi...
subie
1

votes
1

answer
623

Views

Hibernate Envers - How to search for string primary key?

I am unable to find proper query for finding auditing records based on string as a primary key. However all other functionality is running fine with proper auditing of the given table. Here is a code of my domain object: private String userName; private Date createDate; private Date modifyDate; @Id...
Mad Coder
1

votes
1

answer
121

Views

How to search an “ADD” if the object has been deleted

I am trying to look up an object in my envers table, but I dont have the PK. Instead of the PK I have a field ('child') . This is my query, List resultList = reader.createQuery().forRevisionsOfEntity(TP.class, false, true) .add(AuditEntity.property('child').eq(nodeid)).getResultList(); But I get thi...
Johann
1

votes
1

answer
424

Views

Creating multiple custom revision table in envers

I need a help. I was able to setup envers in my project with custom revision entity. But, right now the requirement is that I need to create a separate revision table for User table ( as there as millions of user and for a better performance we dont wanna to put all the audited data in one table) Is...
Rivu
1

votes
1

answer
1.2k

Views

use of hibernate envers with inheritance

Kindly suggest me how to do auditing with inheritance type table per subclass because I am not able to find any documentation for this. I have tried it on my code but it is not working properly. If I make parent table '@Audited' then my derived class must be audited automatically because they should...
rishi
1

votes
1

answer
273

Views

use of hibernate envers 4.2 with hibernate 3.5.5

Is it possible to use hibernate envers 4.2 with hibernate 3.5.5 because I have to use some of the features of envers 4.2 but due to some constraints I can not upgrade my hibernate core version. I am using hibernate 3.5.5 with spring 3.2 and below is my configuration file. org.hibernate.dialect.Oracl...
rishi
1

votes
1

answer
616

Views

use of separate sequence for tables in hibernate envers

I know that hibernate envers uses same sequence for all the audit tables it generates but in my database there are more than 100 tables and they contain millions of data records so I want to use separate sequence for all the tables. Kindly suggest me how to achieve this because I am not able to find...
rishi
1

votes
1

answer
476

Views

Audit tables not created

I am trying to use hibernate envers to audit particular tables. Here is the version I use: org.hibernate hibernate-validator 4.2.0.Final org.hibernate hibernate-envers 4.0.1.Final As far as I understand the only thing I have to do is to add @Audited annotation on my entity class. @Entity @Audited @...
Rodion Nikandrov
1

votes
1

answer
2.5k

Views

Spring Boot + Hibernate Envers. Error creating bean with name 'entityManagerFactory'

I want to use Envers in my app. So I added to my pom.xml hibernate-envers 4.2.19.Final My hibernate version is 4.38 I didn't do anything else, tried to run the tests and it failed Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory...
PaintedRed
1

votes
1

answer
135

Views

Play Framework 1.3 audit not working

I have an app that was built with Play Framework 1.2.7 and use Hibernate Envers to audit some entities (with the @Audited annotation). Some days ago we update the app to use Play Framework 1.3.0 and everything gone great, except for one thing: @Audited stop working. We searched over the internet for...
xrockdawn
1

votes
2

answer
373

Views

Fetching associated entities with AuditQuery

For example I have two entities: @Entity @Audited @Table(.... public class Worker { private Long id; private String name ; } @Entity @Audited @Table(.... public class Department { private Long id; private String departmentName; private Worker worker; } I want to display the following data for Depart...
danizmax
1

votes
1

answer
453

Views

Spring + Hibernate auditing (no Spring Data)

I have joined a project that was built for a year with Spring and Hibernate with Agile methodology and it didn't use Spring Data and has its own user class (not descendent of org.springframework.security.core.userdetails.User ). Auditing came up as a new feauture to be implemented. (It's not enough...
zslevi
1

votes
2

answer
464

Views

Possibility of achieving Envers audit in asynchronous manner

I added Envers into my project and audit tables are updating on entity creating/updating transactions. perfect!! Now I want the execution of audit table updating transaction in an asynchronous manner. What I'm trying to achieve is - even though auditing transaction fails, main transaction should not...
Dinil
1

votes
1

answer
267

Views

Hibernate RevInfo table Rev column is reached to maximum range i.e. 2147483647

in my application I am using hibernate @Audited annotation and all audit related information are storing in *_AUD table correctly. Now the problem is RevInfo table's REV column is reached to its max value i.e. 2147483647 that is integer type now the application is throwing error and value is not ins...
Rohit
1

votes
2

answer
414

Views

CDI Beans and Hibernate Envers

I'm beggining with Hibernate Envers. I'm already able to properly annotate classes with @Audited and create revisions, but I'm unable to record logged user data with my revisions. My JSF 2.0 test application is running on CDI, JPA/Hibernate in a jbossEAP6 / wildfly server. I'm neither using Spring o...
Marcelo Carvalho
1

votes
1

answer
4.9k

Views

Hibernate Envers 4.3 migration to 5.0 - conditional envers auditing

My application uses envers to write data to _aud tables and also to wrap it into an xml that is written into another table. I do it in Envers 4.3 with conditional auditing. My class extends EnversIntegrator @Override public void integrate(Configuration configuration,SessionFactoryImplementor sess...
4444mad
1

votes
1

answer
993

Views

Hibernate Envers Audit table with no suffix

I'm trying to save my audits table in another schema but keeping the tables with the same name of the audited table. I had no problem changing the suffix or using another schema, but when I set the suffix to a empty string I'm getting the following error: Caused by: org.hibernate.DuplicateMappingExc...
Rafael Teles
1

votes
1

answer
71

Views

How to configure common properties for all persistence units in OSGi (e.g. envers config)

I am running an application on an OSGi framework (using karaf) with several bundles defining their own persistence units. The persistence units are defined declarative in persistence.xml files in each bundle. My question is: Is there a way to provide a common configuration to all persistence units i...
Hansa
1

votes
1

answer
184

Views

Envers 4.2.x adds a record to the AUD table even if there are no changes

I'm using Hibernate Envers 4.2.21.FINAL. As I want to track only some properties' changes, I added the annotation @Audited(withModifiedFlag = true) on them. The flag column 'propname_MOD' is correctly created, but the problem is that when I save an object, all the MOD flags are set to true, and not...
SG87
1

votes
1

answer
467

Views

Hibernate Envers based on Field level value change

Problem Summary: Need to take snapshot of a database row only when a particular field changes using Hibernate Envers. Technologies Used: Spring Boot, Spring Data JPA, Hibernate Envers 5.2.10 Current Behavior: Currently i have Hibernate Envers running and it audits the table changes that are made to...
Kannan
1

votes
1

answer
94

Views

is there a way to limit the audit log amount of Hibernate envers?

I am testing the functionality's of hibernate envers, I like the module but I don't want the audit tables to become too big. Can hibernate envers be configured in such a way that the audit table can never exceed a predefined number of audit rows?
Maurice
1

votes
1

answer
196

Views

QueryDSL Access Id column without join

Description We have a case where we are querying out historical information and we'd like to use QueryDSL and not raw SQL. The data in the historical table contains a the id of the original record (Hibernate ENVERs) and in the event of a deletion, the actual record is removed but the ENVERs record c...
gwnp
1

votes
1

answer
35

Views

Is it possible to mix hibernate-envers versions given certain conditions?

I have a large system (A) using hibernate 4.3.11. We want to introduce auditing on a few tables using hibernate-envers. However we want to consume the audit log on a different system (B) that uses hibernate 5. Given that system B only reads from the shared database, is it possible to mix hibernate...
Casey

View additional questions