I'm using java's mybatis,I've implemented interface IBaseBusinessQuery, maping file set method -> T findOne(K var1).
I suspect the reason for the name of the variable,so,I rewrote this method -> @Override T_Permission findOne(String key);,but,the result is so.
implemented interface
public interface IBaseBusinessQuery<T, K> {
T findOne(K var1);
List<T> findAll();
}
dao layer
@Repository("permissionDao")
public interface PermissionDao extends IBaseDao<T_Permission, String>, IBaseBusinessQuery<T_Permission,String> {
}
dao layer After modification
@Repository("permissionDao")
public interface PermissionDao extends IBaseDao<T_Permission, String>, IBaseBusinessQuery<T_Permission,String> {
@Override
T_Permission findOne(String key);
}
mybatis mapping file
<select id="findOne" resultType="T_Permission">
select * from t_permission where `ps_id` = #{key}
</select>
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 6,464 milliseconds ago. The last packet sent successfully to the server was 22 milliseconds ago.