mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#390 - ENH: Add Change log mechanism for easy fine grained logging of insert, update, delete activity.
This adds default implementations for register,filter, prepare and log of the change sets.
This commit is contained in:
@@ -10,8 +10,10 @@ import javax.persistence.OneToMany;
|
||||
import javax.persistence.Version;
|
||||
|
||||
import com.avaje.ebean.annotation.CacheStrategy;
|
||||
import com.avaje.ebean.annotation.ChangeLog;
|
||||
import com.avaje.ebean.annotation.CreatedTimestamp;
|
||||
|
||||
@ChangeLog
|
||||
@Entity
|
||||
@CacheStrategy(naturalKey="email")
|
||||
public class Contact {
|
||||
|
||||
@@ -7,10 +7,12 @@ import javax.validation.constraints.Size;
|
||||
|
||||
import com.avaje.ebean.annotation.CacheStrategy;
|
||||
import com.avaje.ebean.annotation.CacheTuning;
|
||||
import com.avaje.ebean.annotation.ChangeLog;
|
||||
|
||||
/**
|
||||
* Country entity bean.
|
||||
*/
|
||||
@ChangeLog(excludeInserts = true)
|
||||
@CacheStrategy(readOnly=true,warmingQuery="order by name")
|
||||
@CacheTuning(maxSize=500)
|
||||
@Entity
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.avaje.tests.model.basic;
|
||||
|
||||
import com.avaje.ebean.annotation.ChangeLog;
|
||||
import com.avaje.ebean.annotation.EnumValue;
|
||||
import com.avaje.ebean.annotation.JsonIgnore;
|
||||
import com.avaje.ebean.annotation.Where;
|
||||
@@ -20,6 +21,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
/**
|
||||
* Customer entity bean.
|
||||
*/
|
||||
@ChangeLog(excludeInserts = true, updatesThatInclude = {"name","status"})
|
||||
@Entity
|
||||
@Table(name = "o_customer")
|
||||
public class Customer extends BasicDomain {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.sql.Timestamp;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ChangeLog
|
||||
@ChangeLog(updatesThatInclude = {"name","shortDescription"})
|
||||
@Entity
|
||||
public class EBasicChangeLog {
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import javax.persistence.Version;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.avaje.ebean.annotation.ChangeLog;
|
||||
import com.avaje.ebean.annotation.Formula;
|
||||
import com.avaje.ebean.annotation.WhenCreated;
|
||||
import com.avaje.ebean.annotation.Where;
|
||||
@@ -29,6 +30,7 @@ import com.avaje.ebean.annotation.Where;
|
||||
/**
|
||||
* Order entity bean.
|
||||
*/
|
||||
@ChangeLog
|
||||
@Entity
|
||||
@Table(name = "o_order")
|
||||
public class Order implements Serializable {
|
||||
|
||||
Reference in New Issue
Block a user