类 FieldFilterArgsImpl<T extends Table<?>>

java.lang.Object
org.babyfish.jimmer.sql.fetcher.impl.FieldFilterArgsImpl<T>
所有已实现的接口:
Filterable, Sortable, SubQueryProvider, FieldFilterArgs<T>, FieldFilterArgsImplementor<T>

public class FieldFilterArgsImpl<T extends Table<?>> extends Object implements FieldFilterArgsImplementor<T>
  • 方法详细资料

    • of

      public static <T extends Table<?>> FieldFilterArgsImpl<T> of(AbstractMutableQueryImpl query, T table, Collection<Object> keys)
    • isSorted

      public boolean isSorted()
    • getTable

      public T getTable()
      指定者:
      getTable 在接口中 FieldFilterArgs<T extends Table<?>>
    • getKey

      public <K> K getKey()
      指定者:
      getKey 在接口中 FieldFilterArgs<T extends Table<?>>
    • getKeys

      public <K> Collection<K> getKeys()
      指定者:
      getKeys 在接口中 FieldFilterArgs<T extends Table<?>>
    • where

      @OldChain public Sortable where(Predicate... predicates)
      从接口复制的说明: Filterable
      Add some predicates(logical and)
      指定者:
      where 在接口中 Filterable
      指定者:
      where 在接口中 Sortable
      参数:
      predicates - Predicates, everything one can be null
      返回:
      Return the current object to support chain programming style
    • whereIf

      @OldChain @Deprecated public Sortable whereIf(boolean condition, Predicate predicate)
      已过时。
      从接口复制的说明: Filterable
      This method is deprecated, using Dynamic Predicates is a more convenient approach.

      Please look at this example:

      
       whereIf(name != null, table.name().eq(name))
       
      When name is null, this code works because eq(null) is automatically translated by Jimmer to isNull(), which doesn't cause an exception.

      Let's look at another example:

      
       whereIf(minPrice != null, table.price().ge(minPrice))
       
      Except RUST marco, almost all programming languages calculate all parameters first and then call the function. Therefore, before whereIf is executed, ge(null) already causes an exception.

      For this reason, whereIf provides an overloaded form with a lambda parameter:

      
       whereIf(minPrice != null, () -> table.price().ge(minPrice))
       
      Although this overloaded form can solve this problem, it ultimately adds a mental burden during development.

      Therefore, Jimmer provides Dynamic Predicates

      • Java: eqIf, neIf, ltIf, leIf, gtIf, geIf, likeIf, ilikeIf, betweenIf
      • Kotlin: eq?, ne?, lt?, le?, gt?, ge?, like?, ilike?, betweenIf?
      Taking Java's geIf as an example, this functionality is ultimately implemented like this.
      
       where(table.price().geIf(minPrice))
       
      指定者:
      whereIf 在接口中 Filterable
      指定者:
      whereIf 在接口中 Sortable
    • whereIf

      @OldChain public Sortable whereIf(boolean condition, Supplier<Predicate> block)
      从接口复制的说明: Filterable
      Avoid using this method whenever possible, using Dynamic Predicates are a more convenient approach.

      Please look at this example:

      
       whereIf(name != null, table.name().eq(name))
       
      When name is null, this code works because eq(null) is automatically translated by Jimmer to isNull(), which doesn't cause an exception.

      Let's look at another example:

      
       whereIf(minPrice != null, table.price().ge(minPrice))
       
      Except RUST marco, almost all programming languages calculate all parameters first and then call the function. Therefore, before whereIf is executed, ge(null) already causes an exception.

      For this reason, whereIf provides an overloaded form with a lambda parameter:

      
       whereIf(minPrice != null, () -> table.price().ge(minPrice))
       
      Although this overloaded form can solve this problem, it ultimately adds a mental burden during development.

      Therefore, Jimmer provides Dynamic Predicate

      • Java: eqIf, neIf, ltIf, leIf, gtIf, geIf, likeIf, ilikeIf, betweenIf
      • Kotlin: eq?, ne?, lt?, le?, gt?, ge?, like?, ilike?, betweenIf?
      Taking Java's geIf as an example, this functionality is ultimately implemented like this.
      
       where(table.price().geIf(minPrice))
       
      指定者:
      whereIf 在接口中 Filterable
      指定者:
      whereIf 在接口中 Sortable
      参数:
      condition - The condition
      block - A lambda to create predicate when condition is true
      返回:
      Return the current object to support chain programming style
    • orderBy

      @OldChain public Sortable orderBy(Expression<?>... expressions)
      指定者:
      orderBy 在接口中 Sortable
    • orderBy

      @OldChain public Sortable orderBy(Order... orders)
      指定者:
      orderBy 在接口中 Sortable
    • orderBy

      @OldChain public Sortable orderBy(List<Order> orders)
      指定者:
      orderBy 在接口中 Sortable
    • createSubQuery

      public MutableSubQuery createSubQuery(TableProxy<?> table)
      指定者:
      createSubQuery 在接口中 SubQueryProvider
    • createAssociationSubQuery

      public <SE, ST extends TableEx<SE>, TE, TT extends TableEx<TE>> MutableSubQuery createAssociationSubQuery(AssociationTable<SE,ST,TE,TT> table)
      指定者:
      createAssociationSubQuery 在接口中 SubQueryProvider
    • query

      public AbstractMutableQueryImpl query()
      指定者:
      query 在接口中 FieldFilterArgsImplementor<T extends Table<?>>