Search in sources :

Example 11 with ResultFlag

use of org.apache.ibatis.mapping.ResultFlag in project mybatis-3 by mybatis.

the class XMLMapperBuilder method processConstructorElement.

private void processConstructorElement(XNode resultChild, Class<?> resultType, List<ResultMapping> resultMappings) {
    List<XNode> argChildren = resultChild.getChildren();
    for (XNode argChild : argChildren) {
        List<ResultFlag> flags = new ArrayList<>();
        flags.add(ResultFlag.CONSTRUCTOR);
        if ("idArg".equals(argChild.getName())) {
            flags.add(ResultFlag.ID);
        }
        resultMappings.add(buildResultMappingFromContext(argChild, resultType, flags));
    }
}
Also used : XNode(org.apache.ibatis.parsing.XNode) ArrayList(java.util.ArrayList) ResultFlag(org.apache.ibatis.mapping.ResultFlag)

Aggregations

ArrayList (java.util.ArrayList)11 ResultFlag (org.apache.ibatis.mapping.ResultFlag)11 ResultMapping (org.apache.ibatis.mapping.ResultMapping)9 ResultMap (org.apache.ibatis.mapping.ResultMap)7 StaticSqlSource (org.apache.ibatis.builder.StaticSqlSource)6 ParameterMap (org.apache.ibatis.mapping.ParameterMap)6 TypeHandlerRegistry (org.apache.ibatis.type.TypeHandlerRegistry)6 MappedStatement (org.apache.ibatis.mapping.MappedStatement)5 SqlSource (org.apache.ibatis.mapping.SqlSource)5 DynamicSqlSource (org.apache.ibatis.scripting.xmltags.DynamicSqlSource)5 Author (org.apache.ibatis.domain.blog.Author)4 Blog (org.apache.ibatis.domain.blog.Blog)4 Section (org.apache.ibatis.domain.blog.Section)4 Date (java.util.Date)3 List (java.util.List)3 Comment (org.apache.ibatis.domain.blog.Comment)3 Post (org.apache.ibatis.domain.blog.Post)3 Tag (org.apache.ibatis.domain.blog.Tag)3 XNode (org.apache.ibatis.parsing.XNode)2 TypeHandler (org.apache.ibatis.type.TypeHandler)2