以下のようなTestMapper.xml、TestMapper.javaが存在します。
TestMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="common.mappers.TestMapper">
<resultMap id="ResultTest" type="common.entities.Test">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="flg" jdbcType="INTEGER" property="flg" />
</resultMap>
<select id="selectByTest" parameterType="Test" resultMap="ResultTest">
select *
from test
</select>
</mapper>
TestMapper.java
package common.mappers;
import ccommon.entities.Test;
public interface TestMapper {
List<Test> selectByTest();
}
その後、javaクラス(Interceptorクラス)で使用する際にListで使用したい場合は上記のような記述で問題ないでしょうか?
また、全件検索なのですが、上のような書き方のListで問題ないでしょうか?
ご教示いただける方がいましたらお願いいたします。