📄 gaodbinterceptor.java
字号:
package com.jgao.hql.test.business.others;
public class GaodbInterceptor{ //implements Interceptor, Serializable {
// private int updates;
// private int creates;
//
// public void onDelete(Object entity,
// Serializable id,
// Object[] state,
// String[] propertyNames,
// Type[] types) {
// // do nothing
// }
//
// public boolean onFlushDirty(Object entity,
// Serializable id,
// Object[] currentState,
// Object[] previousState,
// String[] propertyNames,
// Type[] types) {
//
// if ( entity instanceof Gaodb ) {
// updates++;
// for ( int i=0; i < propertyNames.length; i++ ) {
// if ( "lastUpdateTimestamp".equals( propertyNames[i] ) ) {
// currentState[i] = new Date();
// return true;
// }
// }
// }
// return false;
// }
//
// public boolean onLoad(Object entity,
// Serializable id,
// Object[] state,
// String[] propertyNames,
// Type[] types) {
// return false;
// }
//
// public boolean onSave(Object entity,
// Serializable id,
// Object[] state,
// String[] propertyNames,
// Type[] types) {
//
// if ( entity instanceof Auditable ) {
// creates++;
// for ( int i=0; i<propertyNames.length; i++ ) {
// if ( "createTimestamp".equals( propertyNames[i] ) ) {
// state[i] = new Date();
// return true;
// }
// }
// }
// return false;
// }
//
// public void postFlush(Iterator entities) {
// System.out.println("Creations: " + creates + ", Updates: " + updates);
// }
//
// public void preFlush(Iterator entities) {
// updates=0;
// creates=0;
// }
//
// public void isUnsaved(Iterator entities) {
// //
// }
//
//// public boolean findDirty(Object entity,
//// Serializable id,
//// Object[] currentState,
//// Object[] previousState,
//// String[] propertyNames,
//// Type[] types) {
//// //
//// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -