![](/img/trans.png)
[英]How do I use an XML ResultMap in an annotated mapper for MyBatis Dynamic SQL?
[英]resultMap in mybatis , I need to pass a List of Strings as return type. How to do this in the mapper file
<select id="getXXX" parameterType="java.util.List" resultMap="?">
</select>
在我的映射器文件中的上述 select 查詢中,我需要將 resultMap 作為字符串列表獲取。 不能直接給出如何作為默認 Collection 實現。
我嘗試使用帶有字符串變量或字符串變量列表的普通 POJO class,但沒有成功。
如果您需要獲取整數集合,請使用以下示例:
<select id="getXXX" resultType="java.lang.Integer">
</select>
如果您需要獲取實體集合:
<select id="getXXX" resultType="com.domain.YourEntity">
</select>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.