簡體   English   中英

mybatis 中的 resultMap,我需要傳遞一個字符串列表作為返回類型。 如何在映射器文件中執行此操作

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM