after Sping Boot integrates Mybatis, set console output to execute SQL
logging:
level:
com...dao: debug
this package is full of mapper interfaces generated by mybatis generator, and the console can output SQL.
in addition, I have defined a general dao interface with the following code
@Component("baseDao")
public class BaseDao extends SqlSessionDaoSupport {
@Resource
public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory){
super.setSqlSessionFactory(sqlSessionFactory);
}
public <T> List<T> queryForList(String statement, Query queryParam){
List<T> list = super.getSqlSession().selectList(statement, queryParam);
return list;
}
public <T> One<T> queryForOne(String statement, Object param){
T t = super.getSqlSession().selectOne(statement, param);
One<T> oneResult = new One<T>();
oneResult.setResult(t);
return oneResult;
}
}
this class is in com. Mosaic. Under the mosaic .base package, I set
logging:
level:
com...base: debug
but the console does not output SQL,. I would like to output the SQL, of baseDao execution in the console. How should I set it?