Class SqlSpec.Default

java.lang.Object
org.huiche.jdbc.SqlSpec.Default
All Implemented Interfaces:
SqlSpec
Enclosing interface:
SqlSpec

public static final class SqlSpec.Default extends Object implements SqlSpec
SqlSpec默认实现
Author:
Maning
  • Method Details

    • query

      public <T> MappedQuery<T> query(RowMapper<T> mapper)
      Description copied from interface: SqlSpec
      通过行转换器返回映射查询
      Specified by:
      query in interface SqlSpec
      Type Parameters:
      T - 查询类型泛型
      Parameters:
      mapper - 行转换器
      Returns:
      已映射查询
    • queryExists

      public boolean queryExists()
      Description copied from interface: SqlSpec
      查询是否存在
      Specified by:
      queryExists in interface SqlSpec
      Returns:
      是否存在
    • update

      public int update()
      Description copied from interface: SqlSpec
      执行sql写操作
      Specified by:
      update in interface SqlSpec
      Returns:
      变动条数|执行结果
    • updateAndPopulateKey

      public int updateAndPopulateKey(int keyCount, String keyColumn, Type keyType, Consumer<Object[]> keyConsumer)
      Description copied from interface: SqlSpec
      执行sql写操作并填充自增字段(一般为主键)
      Specified by:
      updateAndPopulateKey in interface SqlSpec
      Parameters:
      keyCount - 生成key的条数
      keyColumn - 自增字段,oracle需要传入
      keyType - 自增字段类型
      keyConsumer - 自增属性值消费者,第一个参数为自增值,第二个参数为下标,base:0
      Returns:
      变动条数|执行结果