com.yixsoft.support.mybatis.utils.ResultMapUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yixsoft-batis Show documentation
Show all versions of yixsoft-batis Show documentation
YixSoft MyBatis AutoSql Plugin
package com.yixsoft.support.mybatis.utils;
import org.apache.ibatis.mapping.ResultMap;
import org.apache.ibatis.mapping.ResultMapping;
import org.apache.ibatis.session.Configuration;
import java.util.ArrayList;
import java.util.List;
/**
* build json type resultMap
* Created by yixian on 2015-09-02.
*/
public class ResultMapUtils {
public static List createJsonResultMap(Configuration configuration, String statementId, Class resultType) {
ResultMap.Builder builder = new ResultMap.Builder(configuration, statementId + "-Inline", resultType, new ArrayList());
ResultMap map = builder.build();
List maps = new ArrayList<>();
maps.add(map);
return maps;
}
}