private void infoStatistics (SessionFactory sessionFactory) ;
private void infoStatistics (SessionFactory sessionFactory) {
Statistics stats = sessionFactory.getStatistics();
// total statistics
stats.logSummary();
String[] clazz = stats.getEntityNames();
// entity statistics
if (clazz != null && clazz.length > 0) {
for (int i = 0; i < clazz.length; i++) {
EntityStatistics entityStats = stats
.getEntityStatistics(clazz[i]);
System.out.println(clazz[i]);
System.out.println("inserted : " + entityStats.getInsertCount());
System.out.println("updated : " + entityStats.getUpdateCount());
System.out.println("deleted : " + entityStats.getDeleteCount());
System.out.println("loaded : " + entityStats.getLoadCount());
}
}
String[] queries = stats.getQueries();
// queries statistics
if (queries != null && queries.length > 0) {
for (int i = 0; i < queries.length; i++) {
QueryStatistics queryStats = stats
.getQueryStatistics(queries[i]);
System.out.println(queries[i]);
System.out.println("ExecutionAvgTime : "
+ queryStats.getExecutionAvgTime());
System.out.println("ExecutionMinTime : "
+ queryStats.getExecutionMinTime());
System.out.println("ExecutionMaxTime : "
+ queryStats.getExecutionMaxTime());
System.out.println("ExecutionCount : "
+ queryStats.getExecutionCount());
System.out.println("ExecutionRowCount : "
+ queryStats.getExecutionRowCount());
}
}
// clear
stats.clear();
}
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/249132/viewspace-968246/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- hibernate出錯 不能事例sessionFactorySession
- Hibernate原始碼學習五_建立SessionFactory原始碼Session
- 通過註解的方式向DAO中注入SessionfactorySession
- Hibernate中二級快取(sessionFactory)的配置及其使用。快取Session
- Hibernate的一級快取Session和二級快取SessionFactory快取Session
- 如果從oo角度來看sessionfactory的建立,請分析一下?Session
- Hibernate一級快取(session)與二級快取(sessionFactory)的知識點。快取Session
- 你知道void和Void的區別嗎
- 簡述static關鍵字、void與void *(void指標)、函式指標指標函式
- public void sendHtmlHTML
- 通過qsort(void * lineptr[], int left, int rifht, int (*comp)(void *, void *))解讀指標函式和void指標...指標函式
- NSObject +(void)load 和+(void)initialize 方法的理解Object
- TypeScript void 型別TypeScript型別
- JavaScript void 運算子JavaScript
- Javascript:void(0)和#JavaScript
- 24·iOS 面試題·+(void)load; +(void)initialize; 有什麼用處?iOS面試題
- typedef void (*Fun) (void) 的理解——函式指標——typedef函式指標函式指標
- 群暉+Docker Private registryDocker
- 【RAC】如何修改 private ip
- public void setModerationMinThreadValue(int value)thread
- int存放到void指標指標
- 關於C/C++ void指標,使用void指標拷貝int 陣列C++指標陣列
- java筆記14之privateJava筆記
- mysql RSA private key file not foundMySql
- Public Private VIP的區別
- JavaScript 中 void(0) 的含義JavaScript
- 【Linux開發技術之常見問題】一個建立執行緒時常見的問題:invalid conversion from `void*' to `void*(*)(void*)Linux執行緒
- 為什麼用「void 0」代替「undefined」Undefined
- javascript:void(0)的作用是什麼JavaScript
- href="javascript:void(0);" considered harmfulJavaScriptIDE
- jsjavascript:void(0)真正含義(轉)JSJavaScript
- Python 訪問限制 private publicPython
- npm publish gives “unscoped packages cannot be private”NPMPackage
- Amazon Virtual Private Cloud (VPC) 筆記Cloud筆記
- To add private variable to this Javascript literal objectJavaScriptObject
- java中的 public protected friendly privateJava
- Role of Public,Private,Virtual, and SCAN IPs
- VPD--Virtual Private Database / Oracle PolicyDatabaseOracle