Class MappedQuery.Default<T>

java.lang.Object
org.huiche.jdbc.MappedQuery.Default<T>
Type Parameters:
T - 类型
All Implemented Interfaces:
MappedQuery<T>
Enclosing interface:
MappedQuery<T>

public static final class MappedQuery.Default<T> extends Object implements MappedQuery<T>
MappedQuery默认实现
  • Method Details

    • collection

      public <C extends Collection<T>> C collection(C collection)
      Description copied from interface: MappedQuery
      查询为集合
      Specified by:
      collection in interface MappedQuery<T>
      Type Parameters:
      C - 集合类型
      Parameters:
      collection - 集合
      Returns:
      结果(实际为传入的结合对象,填充了结果)
    • first

      public T first(T defaultValue)
      Description copied from interface: MappedQuery
      查询第一条数据,自行确保sql查询结果为一条记录
      Specified by:
      first in interface MappedQuery<T>
      Parameters:
      defaultValue - 默认值
      Returns:
      结果
    • list

      public List<T> list()
      Description copied from interface: MappedQuery
      查询为list
      Specified by:
      list in interface MappedQuery<T>
      Returns:
      结果
    • optional

      public Optional<T> optional()
      Description copied from interface: MappedQuery
      查询为optional
      Specified by:
      optional in interface MappedQuery<T>
      Returns:
      结果
    • set

      public Set<T> set()
      Description copied from interface: MappedQuery
      查询为set,默认使用LikedHashSet实现,保留原顺序
      Specified by:
      set in interface MappedQuery<T>
      Returns:
      结果
    • stream

      public Stream<T> stream(Integer limit)
      Description copied from interface: MappedQuery
      查询为stream
      Specified by:
      stream in interface MappedQuery<T>
      Parameters:
      limit - 限制条数
      Returns:
      结果