Class ScopeBuilder<T extends Model>

java.lang.Object
org.javalite.activejdbc.ScopeBuilder<T>

public class ScopeBuilder<T extends Model> extends Object
Author:
igor on 4/7/18.
  • Constructor Details

    • ScopeBuilder

      public ScopeBuilder(Class<T> modelClass, String[] scopes)
  • Method Details

    • where

      public <T extends Model> LazyList<T> where(String subquery, Object... params)
      Applies additional criteria to scopes defined in the model.
      Parameters:
      subquery - additional criteria.
      params - dynamic parameters for the subquery. Similar to Model.where(String, Object...).
      Returns:
      a list of records filtered by all supplied scopes as well as additional criteria.
    • all

      public <T extends Model> LazyList<T> all()
      Use in case the scopes define all criteria you need.
      Returns:
      all instances of models according to defined scope filters.
    • scope

      public ScopeBuilder<T> scope(String scope)