Java 类org.apache.ibatis.annotations.Arg 实例源码

项目:mybaties    文件:MapperAnnotationBuilder.java   
private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings) {
  for (Arg arg : args) {
    List<ResultFlag> flags = new ArrayList<ResultFlag>();
    flags.add(ResultFlag.CONSTRUCTOR);
    if (arg.id()) {
      flags.add(ResultFlag.ID);
    }
    ResultMapping resultMapping = assistant.buildResultMapping(
        resultType,
        null,
        nullOrEmpty(arg.column()),
        arg.javaType() == void.class ? null : arg.javaType(),
        arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(),
        nullOrEmpty(arg.select()),
        nullOrEmpty(arg.resultMap()),
        null,
        null,
        arg.typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler(),
        flags,
        null,
        null,
        false);
    resultMappings.add(resultMapping);
  }
}
项目:play    文件:MapperAnnotationBuilder.java   
private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings) {
  for (Arg arg : args) {
    List<ResultFlag> flags = new ArrayList<ResultFlag>();
    flags.add(ResultFlag.CONSTRUCTOR);
    if (arg.id()) {
      flags.add(ResultFlag.ID);
    }
    ResultMapping resultMapping = assistant.buildResultMapping(
        resultType,
        null,
        nullOrEmpty(arg.column()),
        arg.javaType() == void.class ? null : arg.javaType(),
        arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(),
        nullOrEmpty(arg.select()),
        nullOrEmpty(arg.resultMap()),
        null,
        null,
        arg.typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler(),
        flags,
        null,
        null,
        false);
    resultMappings.add(resultMapping);
  }
}
项目:mybatis-plus-mini    文件:MybatisMapperAnnotationBuilder.java   
private void applyResultMap(String resultMapId, Class<?> returnType, Arg[] args, Result[] results,
                            TypeDiscriminator discriminator) {
    List<ResultMapping> resultMappings = new ArrayList<>();
    applyConstructorArgs(args, returnType, resultMappings);
    applyResults(results, returnType, resultMappings);
    Discriminator disc = applyDiscriminator(resultMapId, returnType, discriminator);
    // TODO add AutoMappingBehaviour
    assistant.addResultMap(resultMapId, returnType, null, disc, resultMappings, null);
    createDiscriminatorResultMaps(resultMapId, returnType, discriminator);
}
项目:mybatis-plus-mini    文件:MybatisMapperAnnotationBuilder.java   
private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings) {
    for (Arg arg : args) {
        List<ResultFlag> flags = new ArrayList<>();
        flags.add(ResultFlag.CONSTRUCTOR);
        if (arg.id()) {
            flags.add(ResultFlag.ID);
        }
        @SuppressWarnings("unchecked")
        Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>)
                (arg.typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler());
        ResultMapping resultMapping = assistant.buildResultMapping(
                resultType,
                nullOrEmpty(arg.name()),
                nullOrEmpty(arg.column()),
                arg.javaType() == void.class ? null : arg.javaType(),
                arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(),
                nullOrEmpty(arg.select()),
                nullOrEmpty(arg.resultMap()),
                null,
                null,
                typeHandler,
                flags,
                null,
                null,
                false);
        resultMappings.add(resultMapping);
    }
}
项目:MybatisCode    文件:MapperAnnotationBuilder.java   
private void applyResultMap(String resultMapId, Class<?> returnType, Arg[] args, Result[] results, TypeDiscriminator discriminator) {
  List<ResultMapping> resultMappings = new ArrayList<ResultMapping>();
  applyConstructorArgs(args, returnType, resultMappings);
  applyResults(results, returnType, resultMappings);
  Discriminator disc = applyDiscriminator(resultMapId, returnType, discriminator);
  // TODO add AutoMappingBehaviour
  assistant.addResultMap(resultMapId, returnType, null, disc, resultMappings, null);
  createDiscriminatorResultMaps(resultMapId, returnType, discriminator);
}
项目:MybatisCode    文件:MapperAnnotationBuilder.java   
private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings) {
  for (Arg arg : args) {
    List<ResultFlag> flags = new ArrayList<ResultFlag>();
    flags.add(ResultFlag.CONSTRUCTOR);
    if (arg.id()) {
      flags.add(ResultFlag.ID);
    }
    @SuppressWarnings("unchecked")
    Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>)
            (arg.typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler());
    ResultMapping resultMapping = assistant.buildResultMapping(
        resultType,
        null,
        nullOrEmpty(arg.column()),
        arg.javaType() == void.class ? null : arg.javaType(),
        arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(),
        nullOrEmpty(arg.select()),
        nullOrEmpty(arg.resultMap()),
        null,
        null,
        typeHandler,
        flags,
        null,
        null,
        false);
    resultMappings.add(resultMapping);
  }
}
项目:mybatis    文件:MapperAnnotationBuilder.java   
private void applyResultMap(String resultMapId, Class<?> returnType, Arg[] args, Result[] results, TypeDiscriminator discriminator) {
  List<ResultMapping> resultMappings = new ArrayList<ResultMapping>();
  applyConstructorArgs(args, returnType, resultMappings);
  applyResults(results, returnType, resultMappings);
  Discriminator disc = applyDiscriminator(resultMapId, returnType, discriminator);
  // TODO add AutoMappingBehaviour
  assistant.addResultMap(resultMapId, returnType, null, disc, resultMappings, null);
  createDiscriminatorResultMaps(resultMapId, returnType, discriminator);
}
项目:mybatis    文件:MapperAnnotationBuilder.java   
private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings) {
  for (Arg arg : args) {
    List<ResultFlag> flags = new ArrayList<ResultFlag>();
    flags.add(ResultFlag.CONSTRUCTOR);
    if (arg.id()) {
      flags.add(ResultFlag.ID);
    }
    @SuppressWarnings("unchecked")
    Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>)
            (arg.typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler());
    ResultMapping resultMapping = assistant.buildResultMapping(
        resultType,
        null,
        nullOrEmpty(arg.column()),
        arg.javaType() == void.class ? null : arg.javaType(),
        arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(),
        nullOrEmpty(arg.select()),
        nullOrEmpty(arg.resultMap()),
        null,
        null,
        typeHandler,
        flags,
        null,
        null,
        false);
    resultMappings.add(resultMapping);
  }
}
项目:mybatis-plus    文件:MybatisMapperAnnotationBuilder.java   
private void applyResultMap(String resultMapId, Class<?> returnType, Arg[] args, Result[] results,
                            TypeDiscriminator discriminator) {
    List<ResultMapping> resultMappings = new ArrayList<>();
    applyConstructorArgs(args, returnType, resultMappings);
    applyResults(results, returnType, resultMappings);
    Discriminator disc = applyDiscriminator(resultMapId, returnType, discriminator);
    // TODO add AutoMappingBehaviour
    assistant.addResultMap(resultMapId, returnType, null, disc, resultMappings, null);
    createDiscriminatorResultMaps(resultMapId, returnType, discriminator);
}
项目:mybatis-plus    文件:MybatisMapperAnnotationBuilder.java   
private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings) {
    for (Arg arg : args) {
        List<ResultFlag> flags = new ArrayList<>();
        flags.add(ResultFlag.CONSTRUCTOR);
        if (arg.id()) {
            flags.add(ResultFlag.ID);
        }
        @SuppressWarnings("unchecked")
        Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>)
                (arg.typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler());
        ResultMapping resultMapping = assistant.buildResultMapping(
                resultType,
                nullOrEmpty(arg.name()),
                nullOrEmpty(arg.column()),
                arg.javaType() == void.class ? null : arg.javaType(),
                arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(),
                nullOrEmpty(arg.select()),
                nullOrEmpty(arg.resultMap()),
                null,
                null,
                typeHandler,
                flags,
                null,
                null,
                false);
        resultMappings.add(resultMapping);
    }
}
项目:mybaties    文件:MapperAnnotationBuilder.java   
private void applyResultMap(String resultMapId, Class<?> returnType, Arg[] args, Result[] results, TypeDiscriminator discriminator) {
  List<ResultMapping> resultMappings = new ArrayList<ResultMapping>();
  applyConstructorArgs(args, returnType, resultMappings);
  applyResults(results, returnType, resultMappings);
  Discriminator disc = applyDiscriminator(resultMapId, returnType, discriminator);
  // TODO add AutoMappingBehaviour
  assistant.addResultMap(resultMapId, returnType, null, disc, resultMappings, null);
  createDiscriminatorResultMaps(resultMapId, returnType, discriminator);
}
项目:play    文件:MapperAnnotationBuilder.java   
private void applyResultMap(String resultMapId, Class<?> returnType, Arg[] args, Result[] results, TypeDiscriminator discriminator) {
  List<ResultMapping> resultMappings = new ArrayList<ResultMapping>();
  applyConstructorArgs(args, returnType, resultMappings);
  applyResults(results, returnType, resultMappings);
  Discriminator disc = applyDiscriminator(resultMapId, returnType, discriminator);
  // TODO add AutoMappingBehaviour
  assistant.addResultMap(resultMapId, returnType, null, disc, resultMappings, null);
  createDiscriminatorResultMaps(resultMapId, returnType, discriminator);
}
项目:mybatis-3    文件:MapperAnnotationBuilder.java   
private void applyResultMap(String resultMapId, Class<?> returnType, Arg[] args, Result[] results, TypeDiscriminator discriminator) {
  List<ResultMapping> resultMappings = new ArrayList<ResultMapping>();
  applyConstructorArgs(args, returnType, resultMappings);
  applyResults(results, returnType, resultMappings);
  Discriminator disc = applyDiscriminator(resultMapId, returnType, discriminator);
  // TODO add AutoMappingBehaviour
  assistant.addResultMap(resultMapId, returnType, null, disc, resultMappings, null);
  createDiscriminatorResultMaps(resultMapId, returnType, discriminator);
}
项目:mybatis-3    文件:MapperAnnotationBuilder.java   
private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMapping> resultMappings) {
  for (Arg arg : args) {
    List<ResultFlag> flags = new ArrayList<ResultFlag>();
    flags.add(ResultFlag.CONSTRUCTOR);
    if (arg.id()) {
      flags.add(ResultFlag.ID);
    }
    @SuppressWarnings("unchecked")
    Class<? extends TypeHandler<?>> typeHandler = (Class<? extends TypeHandler<?>>)
            (arg.typeHandler() == UnknownTypeHandler.class ? null : arg.typeHandler());
    ResultMapping resultMapping = assistant.buildResultMapping(
        resultType,
        nullOrEmpty(arg.name()),
        nullOrEmpty(arg.column()),
        arg.javaType() == void.class ? null : arg.javaType(),
        arg.jdbcType() == JdbcType.UNDEFINED ? null : arg.jdbcType(),
        nullOrEmpty(arg.select()),
        nullOrEmpty(arg.resultMap()),
        null,
        null,
        typeHandler,
        flags,
        null,
        null,
        false);
    resultMappings.add(resultMapping);
  }
}
项目:mybatis-plus-mini    文件:MybatisMapperAnnotationBuilder.java   
private Arg[] argsIf(ConstructorArgs args) {
    return args == null ? new Arg[0] : args.value();
}
项目:MybatisCode    文件:MapperAnnotationBuilder.java   
private Arg[] argsIf(ConstructorArgs args) {
  return args == null ? new Arg[0] : args.value();
}
项目:MybatisCode    文件:Mapper.java   
@Select("select id, name from product where name = #{value}")
@ConstructorArgs({
  @Arg(id = true, column="id", javaType = ProductId.class, jdbcType=JdbcType.INTEGER),
  @Arg(column="name")
})
Product getProductByNameUsingConstructor(String name);
项目:mybatis    文件:MapperAnnotationBuilder.java   
private Arg[] argsIf(ConstructorArgs args) {
  return args == null ? new Arg[0] : args.value();
}
项目:mybatis    文件:Mapper.java   
@Select("select id, name from product where name = #{value}")
@ConstructorArgs({
  @Arg(id = true, column="id", javaType = ProductId.class, jdbcType=JdbcType.INTEGER),
  @Arg(column="name")
})
Product getProductByNameUsingConstructor(String name);
项目:mybatis-plus    文件:MybatisMapperAnnotationBuilder.java   
private Arg[] argsIf(ConstructorArgs args) {
    return args == null ? new Arg[0] : args.value();
}
项目:mybaties    文件:MapperAnnotationBuilder.java   
private Arg[] argsIf(ConstructorArgs args) {
  return args == null ? new Arg[0] : args.value();
}
项目:play    文件:MapperAnnotationBuilder.java   
private Arg[] argsIf(ConstructorArgs args) {
  return args == null ? new Arg[0] : args.value();
}
项目:storm-sentiment    文件:WordCountDao.java   
/**
 * 查询词频统计结果,查询频次开前的N个结果
 */
@Select("SELECT `word`,`count` FROM `wordcount` ORDER BY `count` DESC LIMIT #{N}")
@ConstructorArgs(value = { @Arg(column = "word", javaType = String.class),
        @Arg(column = "count", javaType = Integer.class) })
@ResultType(value = WordAndCount.class)
public List<WordAndCount> selectWordCountTopN(int N);
项目:mybatis-3    文件:MapperAnnotationBuilder.java   
private Arg[] argsIf(ConstructorArgs args) {
  return args == null ? new Arg[0] : args.value();
}
项目:mybatis-3    文件:Mapper.java   
@Select("select id, name from product where name = #{value}")
@ConstructorArgs({
  @Arg(id = true, column="id", javaType = ProductId.class, jdbcType=JdbcType.INTEGER),
  @Arg(column="name")
})
Product getProductByNameUsingConstructor(String name);
项目:mybatis-3    文件:InvalidNamedConstructorArgsTest.java   
@ConstructorArgs({
    @Arg(column = "id", name = "noSuchConstructorArg"),
})
@Select("select * from users ")
User select();
项目:mybatis-3    文件:InvalidNamedConstructorArgsTest.java   
@ConstructorArgs({
    @Arg(column = "id", name = "id", javaType = Integer.class),
})
@Select("select * from users ")
User select();
项目:mybatis-3    文件:InvalidNamedConstructorArgsTest.java   
@ConstructorArgs({
    @Arg(column = "id", name = "id"),
})
@Select("select * from users ")
User select();