jchanghong.autoconfig.db.mybatis.ResultSetHandlerPlugin.kt Maven / Gradle / Ivy
package jchanghong.autoconfig.db.mybatis;
import org.apache.ibatis.executor.resultset.ResultSetHandler
import org.apache.ibatis.plugin.Interceptor
import org.apache.ibatis.plugin.Intercepts
import org.apache.ibatis.plugin.Invocation
import org.apache.ibatis.plugin.Signature
import java.sql.CallableStatement
import java.sql.Statement
/**
\* Created with IntelliJ IDEA.
\* User: jiang
\* Date: 2020/1/5
\* Time: 14:59
\*/
//@Intercepts(
// value = [Signature(type = ResultSetHandler::class, method = "handleResultSets", args = [Statement::class]),
// Signature(type = ResultSetHandler::class, method = "handleOutputParameters", args = [CallableStatement::class])
// ]
//)
//class ResultSetHandlerPlugin : Interceptor {
// override fun intercept(invocation: Invocation): Any? {
// var proceed = invocation.proceed()
// if (invocation.method.name == "handleResultSets") {
// handleResultSets(invocation.args[0] as Statement?, proceed)
// }
// return proceed
// }
//
// fun handleResultSets(stmt: Statement?, result: Any?) {
// if (stmt == null || result == null) {
// return
// }
// }
//}
fun main() {
}
// List handleResultSets(Statement stmt) throws SQLException;
//
// Cursor handleCursorResultSets(Statement stmt) throws SQLException;
//
// void handleOutputParameters(CallableStatement cs) throws SQLException;