mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
#405 - ENH: Add @ReadAudit and associated functionality for auditing reads including queries and L2 cache access
This commit is contained in:
1 parent
c292da736b
commit
54172aec6c
54 files changed
+2020
-200
No files matched your search
@@ -17,6 +17,7 @@ import com.avaje.ebean.bean.ObjectGraphNode;
|
||||
import com.avaje.ebean.bean.ObjectGraphOrigin;
|
||||
import com.avaje.ebean.bean.PersistenceContext;
|
||||
import com.avaje.ebean.event.BeanQueryRequest;
|
||||
import com.avaje.ebean.event.readaudit.ReadEvent;
|
||||
import com.avaje.ebean.text.PathProperties;
|
||||
import com.avaje.ebeaninternal.api.BindParams;
|
||||
import com.avaje.ebeaninternal.api.HashQuery;
|
||||
@@ -135,6 +136,11 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
*/
|
||||
private boolean futureFetch;
|
||||
|
||||
/**
|
||||
* Only used for read auditing with findFutureList() query.
|
||||
*/
|
||||
private ReadEvent futureFetchAudit;
|
||||
|
||||
private List<Object> partialIds;
|
||||
|
||||
private int timeout;
|
||||
@@ -173,6 +179,8 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
private Timestamp versionsStart;
|
||||
private Timestamp versionsEnd;
|
||||
|
||||
private boolean disableReadAudit;
|
||||
|
||||
private int bufferFetchSizeHint;
|
||||
|
||||
private boolean usageProfiling = true;
|
||||
@@ -1320,6 +1328,16 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
return bufferFetchSizeHint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Query<T> setDisableReadAuditing() {
|
||||
this.disableReadAudit = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isDisableReadAudit() {
|
||||
return disableReadAudit;
|
||||
}
|
||||
|
||||
public void setBeanCollectionTouched(BeanCollectionTouched notify) {
|
||||
this.beanCollectionTouched = notify;
|
||||
}
|
||||
@@ -1344,6 +1362,16 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
this.futureFetch = backgroundFetch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFutureFetchAudit(ReadEvent event) {
|
||||
this.futureFetchAudit = event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReadEvent getFutureFetchAudit() {
|
||||
return futureFetchAudit;
|
||||
}
|
||||
|
||||
public void setCancelableQuery(CancelableQuery cancelableQuery) {
|
||||
synchronized (this) {
|
||||
this.cancelableQuery = cancelableQuery;
|
||||
|
||||
Reference in new issue
Block a user