- 浏览: 251974 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
wilsonchen:
...
pdf.js html5展现pdf -
angole:
不错,又学习到了。
mybatis打印sql -
hft24dq:
rxcss66 写道 个人没有搞明白什么原理,不过跟一楼说的一 ...
mybatis打印sql -
fireinjava:
fireinjava 写道org.apache.ibatis. ...
mybatis打印sql -
fireinjava:
org.apache.ibatis.logging.LogFa ...
mybatis打印sql
原文地址:http://get2java.wordpress.com/2011/06/27/envers-easy-auditing-for-entity-classes/
Have you tracked your Entity Objects ? When it has created,modified and deleted with time.
Try Envers for Easy Auditing of Entity Classes. Very simple to audit your Entity classes using @Audited. Envers now becomes a part of Hibernate 3.5.
List of libraries you need for this
hibernate3.jar
antlr.jar
commons-collections.jar
dom4j-1.6.1.jar
javassist.jar
jpa-api-2.0-1.jar
jta.jar
mysql-connector-java-5.1.3-rc-bin.jar
slf4j-api-1.6.1.jar
1. hibernate.cfg.xml
Add the Audit Event Listeners in your hibernate.cfg.xml
01
<?xml version="1.0" encoding="UTF-8"?>
02
<!DOCTYPE hibernate-configuration PUBLIC
03
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
04
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
05
<hibernate-configuration>
06
<session-factory>
07
<!-- Database connection settings -->
08
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
09
<property name="connection.url">jdbc:mysql://localhost:3306/envers</property>
10
<property name="connection.username">root</property>
11
<property name="connection.password">welcome123</property>
12
<!-- JDBC connection pool (use the built-in) -->
13
<property name="connection.pool_size">1</property>
14
<!-- SQL dialect -->
15
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
16
<!-- Enable Hibernate's automatic session context management -->
17
<property name="current_session_context_class">thread</property>
18
<!-- Disable the second-level cache -->
19
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
20
<!-- Echo all executed SQL to stdout -->
21
<property name="show_sql">true</property>
22
<!-- Drop and re-create the database schema on startup -->
23
<property name="hbm2ddl.auto">update</property>
24
<mapping/>
25
<!-- Hibernate ENVERS Listener Configuration -->
26
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-insert"/>
27
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-update"/>
28
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-delete"/>
29
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-update"/>
30
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-remove"/>
31
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-collection-recreate"/>
32
</session-factory>
33
</hibernate-configuration>
2. Entity Class
Your Entity class should have @Audited for tracking the values in the persistent class.
01
package com;
02
import java.io.Serializable;
03
import javax.persistence.Column;
04
import javax.persistence.Entity;
05
import javax.persistence.GeneratedValue;
06
import javax.persistence.Id;
07
import javax.persistence.Table;
08
import org.hibernate.envers.Audited;
09
10
/**
11
* @author Anand
12
*
13
*/
14
@Entity
15
@Table(name="user")
16
@Audited //---------------- This is more important!!!!!!!!
17
public class User implements Serializable {
18
@Id
19
@GeneratedValue
20
@Column(name="id")
21
private int id;
22
@Column(name="firstname")
23
private String firstname;
24
@Column(name="lastname")
25
private String lastname;
26
@Column(name="email")
27
private String email;
28
/**
29
* @return the email
30
*/
31
public String getEmail() {
32
return email;
33
}
34
/**
35
* @param email the email to set
36
*/
37
public void setEmail(String email) {
38
this.email = email;
39
}
40
/**
41
* @return the firstname
42
*/
43
public String getFirstname() {
44
return firstname;
45
}
46
/**
47
* @param firstname the firstname to set
48
*/
49
public void setFirstname(String firstname) {
50
this.firstname = firstname;
51
}
52
/**
53
* @return the id
54
*/
55
public int getId() {
56
return id;
57
}
58
/**
59
* @param id the id to set
60
*/
61
public void setId(int id) {
62
this.id = id;
63
}
64
/**
65
* @return the lastname
66
*/
67
public String getLastname() {
68
return lastname;
69
}
70
/**
71
* @param lastname the lastname to set
72
*/
73
public void setLastname(String lastname) {
74
this.lastname = lastname;
75
}
76
}
3. DB Structure of your Entity class
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
firstname varchar(128) YES NULL
lastname varchar(128) YES NULL
email varchar(64) YES NULL
4. Insert the data
Now lets begin with Insert the data
Add the data to your Entity Class
1
User user = new User();
2
user.setFirstname("biju");
3
user.setLastname("cd");
4
user.setEmail("cdbiju@gmail.com");
Get the Session Factory and Session to save the data into DB
01
/** Getting the Session Factory and session */
02
//SessionFactory sessionfactory = HibernateUtil.getSessionFactory();
03
SessionFactory sessionfactory = new AnnotationConfiguration().configure().buildSessionFactory();
04
Session sess = sessionfactory.getCurrentSession();
05
/** Starting the Transaction */
06
Trans)action tx = sess.beginTransaction();
07
/** Saving POJO */
08
sess.save(user);
09
/** Commiting the changes */
10
tx.commit();
11
System.out.println("Record Inserted");
12
/** Closing Session */
13
sessionfactory.close();
5. New Tables Created for holding the Revision Entries
Table 1 : user_aud(Audit Table)
Audit table will have the default suffix to be _aud and present in the default schema of the database.
It has the same structure as the Entity table. Additionally it has three columns in it namely
id
REV
REVINFO
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
REV int(11) NO PRI NULL
REVTYPE tinyint(11) YES
firstname varchar(128) YES NULL
lastname varchar(128) YES NULL
email varchar(64) YES NULL
Table 2 : revinfo(common table for the Entity)
This revinfo table will be common for all the Entity classes.
Field Type Null Key Default Extra
REV int(11) NO PRI NULL auto_increment
REVTSTMP bigint(20) YES
This two tables will be automatically created.
6. Entries in the Audit table and Revinfo table after insert
id REV REVTYPE email firstname lastname
1 1 0 cdbiju@gmail.com biju cd
Here the id column is foreign key for the entity class “user”, REV will be primary key for the audited table. More Importantly the REVTYPE has three values in it.
0 = Creation
1 = Update
2 = Delete
Whenever the insertion takes for the entity class “user”, it makes an entry as Zero and keeps all the Audited columns values in it. (0 = Creation)
Look into Revinfo table
REV REVTSTMP
1 134343453534434
It contains the Revision Timestamp value.
7. Update the data and Look into Audit Tables
1
User user = new User();
2
user.setId(1); // Passes the id=1 to the Entity Class
01
/** Getting the Session Factory and session */
02
SessionFactory sessionfactory = HibernateUtil.getSessionFactory();
03
Session sess = sessionfactory.getCurrentSession();
04
/** Starting the Transaction */
05
Transaction tx = sess.beginTransaction();
06
User u = (User) sess.get(User.class, user.getId());
07
u.setFirstname("biju-append");
08
u.setLastname("cd-append");
09
u.setEmail("cdbiju-append@gmail.com");
10
sess.saveOrUpdate(u);
11
/** Commiting the changes */
12
tx.commit();
13
System.out.println("Record Updated");
14
/** Closing Session */
15
sessionfactory.close();
Look into the Audit Table
id REV REVTYPE email firstname lastname
1 1 0 cdbiju@gmail.com biju Cd
1 2 1 cdbiju-append@gmail.com
biju-append
cd-append
Note 1 is for Update (REVTYPE)
REV REVTSTMP
1 134343453534434
2 134343453534434
When we update the same record, it updates the Audited columns values and update the REVTYPE to be 1.( 1 = Updation)
8. Delete the data and Look into Audit Tables
1
User user = new User();
2
user.setId(1); // Passes the id=1 to the Entity Class to delete
01
/** Getting the Session Factory and session */
02
SessionFactory sessionfactory = HibernateUtil.getSessionFactory();
03
Session sess = sessionfactory.getCurrentSession();
04
/** Starting the Transaction */
05
Transaction tx = sess.beginTransaction();
06
User u = (User) sess.get(User.class, user.getId());
07
sess.delete(u);
08
/** Commiting the changes */
09
tx.commit();
10
System.out.println("Record Deleted");
11
/** Closing Session */
12
sessionfactory.close();
Look into the Audit Table
id REV REVTYPE email firstname lastname
1 1 0 cdbiju@gmail.com biju Cd
1 2 1 cdbiju-append@gmail.com
biju-append
cd-append
1 3 2 NULL
NULL
NULL
Note 2 is for Delete (REVTYPE)
REV REVTSTMP
1 134343453534434
2 134343453534434
3 134343452343243
When the data is Deleted, the row has been deleted in the Entity table . But in the Audited Table, it updates all the Audited columns to be NULL and updates the REVTYPE to be 2.(2 = Delete)
Have you tracked your Entity Objects ? When it has created,modified and deleted with time.
Try Envers for Easy Auditing of Entity Classes. Very simple to audit your Entity classes using @Audited. Envers now becomes a part of Hibernate 3.5.
List of libraries you need for this
hibernate3.jar
antlr.jar
commons-collections.jar
dom4j-1.6.1.jar
javassist.jar
jpa-api-2.0-1.jar
jta.jar
mysql-connector-java-5.1.3-rc-bin.jar
slf4j-api-1.6.1.jar
1. hibernate.cfg.xml
Add the Audit Event Listeners in your hibernate.cfg.xml
01
<?xml version="1.0" encoding="UTF-8"?>
02
<!DOCTYPE hibernate-configuration PUBLIC
03
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
04
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
05
<hibernate-configuration>
06
<session-factory>
07
<!-- Database connection settings -->
08
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
09
<property name="connection.url">jdbc:mysql://localhost:3306/envers</property>
10
<property name="connection.username">root</property>
11
<property name="connection.password">welcome123</property>
12
<!-- JDBC connection pool (use the built-in) -->
13
<property name="connection.pool_size">1</property>
14
<!-- SQL dialect -->
15
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
16
<!-- Enable Hibernate's automatic session context management -->
17
<property name="current_session_context_class">thread</property>
18
<!-- Disable the second-level cache -->
19
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
20
<!-- Echo all executed SQL to stdout -->
21
<property name="show_sql">true</property>
22
<!-- Drop and re-create the database schema on startup -->
23
<property name="hbm2ddl.auto">update</property>
24
<mapping/>
25
<!-- Hibernate ENVERS Listener Configuration -->
26
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-insert"/>
27
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-update"/>
28
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-delete"/>
29
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-update"/>
30
<listener class="org.hibernate.envers.event.AuditEventListener" type="pre-collection-remove"/>
31
<listener class="org.hibernate.envers.event.AuditEventListener" type="post-collection-recreate"/>
32
</session-factory>
33
</hibernate-configuration>
2. Entity Class
Your Entity class should have @Audited for tracking the values in the persistent class.
01
package com;
02
import java.io.Serializable;
03
import javax.persistence.Column;
04
import javax.persistence.Entity;
05
import javax.persistence.GeneratedValue;
06
import javax.persistence.Id;
07
import javax.persistence.Table;
08
import org.hibernate.envers.Audited;
09
10
/**
11
* @author Anand
12
*
13
*/
14
@Entity
15
@Table(name="user")
16
@Audited //---------------- This is more important!!!!!!!!
17
public class User implements Serializable {
18
@Id
19
@GeneratedValue
20
@Column(name="id")
21
private int id;
22
@Column(name="firstname")
23
private String firstname;
24
@Column(name="lastname")
25
private String lastname;
26
@Column(name="email")
27
private String email;
28
/**
29
* @return the email
30
*/
31
public String getEmail() {
32
return email;
33
}
34
/**
35
* @param email the email to set
36
*/
37
public void setEmail(String email) {
38
this.email = email;
39
}
40
/**
41
* @return the firstname
42
*/
43
public String getFirstname() {
44
return firstname;
45
}
46
/**
47
* @param firstname the firstname to set
48
*/
49
public void setFirstname(String firstname) {
50
this.firstname = firstname;
51
}
52
/**
53
* @return the id
54
*/
55
public int getId() {
56
return id;
57
}
58
/**
59
* @param id the id to set
60
*/
61
public void setId(int id) {
62
this.id = id;
63
}
64
/**
65
* @return the lastname
66
*/
67
public String getLastname() {
68
return lastname;
69
}
70
/**
71
* @param lastname the lastname to set
72
*/
73
public void setLastname(String lastname) {
74
this.lastname = lastname;
75
}
76
}
3. DB Structure of your Entity class
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
firstname varchar(128) YES NULL
lastname varchar(128) YES NULL
email varchar(64) YES NULL
4. Insert the data
Now lets begin with Insert the data
Add the data to your Entity Class
1
User user = new User();
2
user.setFirstname("biju");
3
user.setLastname("cd");
4
user.setEmail("cdbiju@gmail.com");
Get the Session Factory and Session to save the data into DB
01
/** Getting the Session Factory and session */
02
//SessionFactory sessionfactory = HibernateUtil.getSessionFactory();
03
SessionFactory sessionfactory = new AnnotationConfiguration().configure().buildSessionFactory();
04
Session sess = sessionfactory.getCurrentSession();
05
/** Starting the Transaction */
06
Trans)action tx = sess.beginTransaction();
07
/** Saving POJO */
08
sess.save(user);
09
/** Commiting the changes */
10
tx.commit();
11
System.out.println("Record Inserted");
12
/** Closing Session */
13
sessionfactory.close();
5. New Tables Created for holding the Revision Entries
Table 1 : user_aud(Audit Table)
Audit table will have the default suffix to be _aud and present in the default schema of the database.
It has the same structure as the Entity table. Additionally it has three columns in it namely
id
REV
REVINFO
Field Type Null Key Default Extra
id int(11) NO PRI NULL auto_increment
REV int(11) NO PRI NULL
REVTYPE tinyint(11) YES
firstname varchar(128) YES NULL
lastname varchar(128) YES NULL
email varchar(64) YES NULL
Table 2 : revinfo(common table for the Entity)
This revinfo table will be common for all the Entity classes.
Field Type Null Key Default Extra
REV int(11) NO PRI NULL auto_increment
REVTSTMP bigint(20) YES
This two tables will be automatically created.
6. Entries in the Audit table and Revinfo table after insert
id REV REVTYPE email firstname lastname
1 1 0 cdbiju@gmail.com biju cd
Here the id column is foreign key for the entity class “user”, REV will be primary key for the audited table. More Importantly the REVTYPE has three values in it.
0 = Creation
1 = Update
2 = Delete
Whenever the insertion takes for the entity class “user”, it makes an entry as Zero and keeps all the Audited columns values in it. (0 = Creation)
Look into Revinfo table
REV REVTSTMP
1 134343453534434
It contains the Revision Timestamp value.
7. Update the data and Look into Audit Tables
1
User user = new User();
2
user.setId(1); // Passes the id=1 to the Entity Class
01
/** Getting the Session Factory and session */
02
SessionFactory sessionfactory = HibernateUtil.getSessionFactory();
03
Session sess = sessionfactory.getCurrentSession();
04
/** Starting the Transaction */
05
Transaction tx = sess.beginTransaction();
06
User u = (User) sess.get(User.class, user.getId());
07
u.setFirstname("biju-append");
08
u.setLastname("cd-append");
09
u.setEmail("cdbiju-append@gmail.com");
10
sess.saveOrUpdate(u);
11
/** Commiting the changes */
12
tx.commit();
13
System.out.println("Record Updated");
14
/** Closing Session */
15
sessionfactory.close();
Look into the Audit Table
id REV REVTYPE email firstname lastname
1 1 0 cdbiju@gmail.com biju Cd
1 2 1 cdbiju-append@gmail.com
biju-append
cd-append
Note 1 is for Update (REVTYPE)
REV REVTSTMP
1 134343453534434
2 134343453534434
When we update the same record, it updates the Audited columns values and update the REVTYPE to be 1.( 1 = Updation)
8. Delete the data and Look into Audit Tables
1
User user = new User();
2
user.setId(1); // Passes the id=1 to the Entity Class to delete
01
/** Getting the Session Factory and session */
02
SessionFactory sessionfactory = HibernateUtil.getSessionFactory();
03
Session sess = sessionfactory.getCurrentSession();
04
/** Starting the Transaction */
05
Transaction tx = sess.beginTransaction();
06
User u = (User) sess.get(User.class, user.getId());
07
sess.delete(u);
08
/** Commiting the changes */
09
tx.commit();
10
System.out.println("Record Deleted");
11
/** Closing Session */
12
sessionfactory.close();
Look into the Audit Table
id REV REVTYPE email firstname lastname
1 1 0 cdbiju@gmail.com biju Cd
1 2 1 cdbiju-append@gmail.com
biju-append
cd-append
1 3 2 NULL
NULL
NULL
Note 2 is for Delete (REVTYPE)
REV REVTSTMP
1 134343453534434
2 134343453534434
3 134343452343243
When the data is Deleted, the row has been deleted in the Entity table . But in the Audited Table, it updates all the Audited columns to be NULL and updates the REVTYPE to be 2.(2 = Delete)
发表评论
-
spring send gmail
2012-04-24 11:06 1149只要这样配置好久能使用gmail了 <bean id= ... -
log4j 常用配置
2012-03-22 21:02 1100原文地址:http://www.benmccann.com/d ... -
Dependency Injection - An Introductory Tutorial - Part 1
2012-02-20 10:57 1209原文地址:http://code.google.com/p/j ... -
struts2 排除拦截部分路径
2011-11-30 13:27 5785情况:在web.xml中配置一个servlet映射路径为/te ... -
java image scale
2011-07-20 13:47 931http://code.google.com/p/java-i ... -
实现自定义截取图片
2011-07-13 17:30 1110几种插件: http://odyniec.net/projec ... -
jms基础概念和应用场景
2011-07-01 13:55 1606原文地址:http://blog.csdn.net/KimmK ... -
JSON Compression algorithms: HPack VS CJSON
2011-06-28 17:24 3162总结:HPack 优于 CJSON json1 json2 ... -
Why we don’t use Doubles for Financial Calculations
2011-06-27 11:14 1296原文地址:http://bloodredsun.com/?p= ... -
http://jbaruch.wordpress.com/2011/06/22/unified-logging-using-slf4j/
2011-06-27 10:48 1213原文地址:http://jbaruch.wordpress.c ... -
Sturts2 全局异常日志
2011-06-25 10:50 1814原文地址:http://www.brucephillips.n ... -
eclipse的build与clean
2011-06-22 09:01 1582现象:无论怎么改变代码,程序的行为始终不变,一直报错。。。。 ... -
jfreechart 图标各部分名字
2011-06-09 19:57 844图标各部分名字 -
jfreechart 自定义饼图颜色
2011-06-09 18:52 4909关键代码: private static class Pi ... -
jfreechart demo 代码
2011-06-07 18:33 2962jfreechart 官方demo 源代码 -
jfreechart 中文问题
2011-06-07 16:52 952基本如果将jfreechart生成图片的字体多改成中文的字体就 ... -
SVN 安装
2011-05-30 15:45 1023collabnet svn 现在出了整和的SVN EDGE。这 ... -
amazon 云计算
2011-05-28 21:45 1087最近看了amazon的云计算 ... -
c3p0 java.lang.Exception: DEBUG -- CLOSE BY CLIENT STACK TRACE
2011-05-28 16:07 1590修改日志级别为info http://hi.baidu.com ... -
mybatis打印sql
2011-05-09 15:03 20017mybatis默认使用log4j,当有self4j这个日志ja ...
相关推荐
4. **自定义修订实体**:通过实现 `org.hibernate.envers.RevisionEntity` 接口并配置 `hibernate.envers.revision_entity_class`,可以定义包含额外修订信息的自定义实体。 ### 4. 示例代码 ```java @Entity @...
### Envers中文文档知识点概述 #### 一、Envers简介 **Envers** 是 **Hibernate** 的一个扩展模块,主要用于实现实体数据的历史版本控制。它的工作原理类似于版本控制系统(如Subversion或Git),通过在数据库中...
Spring Data Envers API(Spring Data Envers 开发文档).CHM 官网 Spring Data Envers API
### Hibernate Envers:简易实体审计指南 #### 一、引言 Hibernate Envers项目旨在为持久化类提供简便的审计功能。用户只需在希望审计的持久化类或其属性上标注`@Audited`注解即可。对于每个被审计的实体,会创建一...
Hibernate Envers 是一个强大的审计框架,它与 Hibernate ORM 框架紧密集成,用于记录数据库实体的历史版本。Envers 的主要目标是为应用程序提供数据变更的跟踪,以便于数据恢复、合规性检查以及问题分析。 Envers ...
hibernate-envers-4.2.4.Final.jar
在例子中,`User`类是被审计的对象,使用了`@Entity`注解声明为JPA实体,`@Table`指定对应的数据库表名,`@Audited`则表明这个类将被Envers进行审计。`@JsonIgnoreProperties`是为了避免处理懒加载相关的属性,防止...
2. **审计监听器**:在`persistence.xml`中配置Envers的监听器,如`<property name="org.hibernate.envers.audit_table_suffix" value="_AUD"/>`,设置审计表的后缀。 3. **查询历史数据**:使用`AuditReader`来...
Envers 上的简单应用程序现有应用程序是在 hibernate 3.5.0 上编写的,数据库连接到 SQL Server(数据库名称“test”)。 DB Config 记录在 hibernate-cfg.xml 中。 envers 的测试是用 HibernateTest.java 编写的
这个注解告诉Hibernate Envers模块(一个用于审计的扩展)该实体需要被审计,Envers会自动生成一个审计表来存储历史版本。 接着,为了实现审计日志,我们需要在项目中引入Hibernate Envers的依赖。在Maven的pom.xml...
“hibernate-envers:有机会使用 Envers 对 eXo 的 wiki 实体进行版本控制” 暗示我们将讨论如何利用Hibernate Envers这个强大的审计框架,为eXo平台中的wiki实体实现版本管理功能。Envers是Hibernate的一个扩展,...
标题“jhipster-app-envers”指的是一个基于JHipster框架并集成了Envers审计功能的应用程序项目。JHipster是一个开源的开发工具,用于快速生成高质量的Java微服务架构和前端应用。它采用Spring Boot和Angular(或...
概述 该应用程序演示了如何将与用于数据库记录的审计和版本控制。执照该示例应用程序及其关联的源代码全部按照以下许可条款提供。 Copyright (C) 2014Permission is hereby granted, free of charge, to any person ...
envers-validation-maven-plugin 这是一个Maven插件,用于验证由hibernate-envers生成/管理的审核修订的结构和内容。 此插件对表结构或内容并非始终由Envers生成的数据库特别有用。 例如,在数据库中,DBA有时会...
java运行依赖jar包
Hibernate启用演示问题陈述这是一个使用Hibernate Envers,Spring boot和AngularJS的演示项目。 它旨在作为称为“四眼原理”( )的实际用例的解决方案。 此用例的主要参与者是“制造者”和“检查者”。 第一个将对...
在本项目中,我们关注的是一个名为"test-delete"的Spring Boot应用,它涉及到使用CRUDRepository和Hibernate Envers进行数据库操作,特别是针对数据的创建、读取、更新和删除(CRUD)功能。让我们深入探讨一下这个...
**Hibernate Envers 用户指南中文版** Hibernate 是一个流行的开源对象关系映射(ORM)框架,它使得Java开发者能够更方便地在关系型数据库上操作对象。而Hibernate Envers 是 Hibernate 的一个扩展,专注于数据审计...
该项目是项目的扩展,允许访问由Hibernate Envers管理的实体修订版。 来源主要来自PhilippHügelmeyer 的贡献。 该模块的核心功能包括Spring Data Commons的RevisionRepository的实现。 public interface ...
用法如果您想运行项目,则只需运行SampleDataJpaApplication中的主方法。 该项目包括一个H2控制台,因此您可以在任何浏览器上查看您的数据库。 尝试: 转到 在登录表单中,请添加以下信息: JDBC URL:jdbc:h2:mem...