|
@ -3,14 +3,10 @@ package com.yihu.hos.interceptor;
|
|
import com.yihu.hos.common.constants.ContextAttributes;
|
|
import com.yihu.hos.common.constants.ContextAttributes;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.hibernate.EmptyInterceptor;
|
|
import org.hibernate.EmptyInterceptor;
|
|
import org.hibernate.type.Type;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author HZY
|
|
* @author HZY
|
|
* @vsrsion 1.0
|
|
* @vsrsion 1.0
|
|
@ -34,23 +30,23 @@ public class AuditInterceptor extends EmptyInterceptor {
|
|
return super.onPrepareStatement(completeSql);
|
|
return super.onPrepareStatement(completeSql);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
public void onDelete(
|
|
|
|
Object entity,
|
|
|
|
Serializable id,
|
|
|
|
Object[] state,
|
|
|
|
String[] propertyNames,
|
|
|
|
Type[] types) {
|
|
|
|
System.out.println("33333333333333");
|
|
|
|
super.onDelete(entity,id,state,propertyNames,types);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void preFlush(Iterator entities) {
|
|
|
|
System.out.println("preflush..............");
|
|
|
|
super.preFlush(entities);
|
|
|
|
}
|
|
|
|
|
|
// @Override
|
|
|
|
// public void onDelete(
|
|
|
|
// Object entity,
|
|
|
|
// Serializable id,
|
|
|
|
// Object[] state,
|
|
|
|
// String[] propertyNames,
|
|
|
|
// Type[] types) {
|
|
|
|
// System.out.println("33333333333333");
|
|
|
|
// super.onDelete(entity,id,state,propertyNames,types);
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
// public void preFlush(Iterator entities) {
|
|
|
|
// System.out.println("preflush..............");
|
|
|
|
// super.preFlush(entities);
|
|
|
|
// }
|
|
|
|
|
|
private String getSchema() {
|
|
private String getSchema() {
|
|
return LocalContext.getContext().getAttachment(ContextAttributes.SCHEMA);
|
|
return LocalContext.getContext().getAttachment(ContextAttributes.SCHEMA);
|