Interface EntityConditionModel

All Superinterfaces:
TableConditionModel<Attribute<?>>

public interface EntityConditionModel extends TableConditionModel<Attribute<?>>
This interface defines filtering functionality, which refers to showing/hiding entities already available in a table model and searching functionality, which refers to configuring the underlying query, which then needs to be re-run. Factory for EntityConditionModel instances via entityConditionModel(EntityType, EntityConnectionProvider, ConditionModel.Factory)
  • Method Details

    • entityType

      EntityType entityType()
      Returns:
      the type of the entity this table condition model is based on
    • connectionProvider

      EntityConnectionProvider connectionProvider()
      Returns:
      the connection provider
    • setEqualOperand

      <T> boolean setEqualOperand(Attribute<T> attribute, T operand)
      Sets the EQUAL condition operand of the condition model associated with attribute. Enables the condition model in case operand is non-empty or disables it if operand is empty.
      Type Parameters:
      T - the operand type
      Parameters:
      attribute - the attribute
      operand - the search condition operand
      Returns:
      true if the search state changed as a result of this method call, false otherwise
    • setInOperands

      <T> boolean setInOperands(Attribute<T> attribute, Collection<T> operands)
      Sets the IN condition operands of the condition model associated with attribute. Enables the condition model in case operands is non-empty or disables it if operands is empty.
      Type Parameters:
      T - the value type
      Parameters:
      attribute - the attribute
      operands - the search condition operands, an empty Collection for none
      Returns:
      true if the search state changed as a result of this method call, false otherwise
    • where

      Condition where(Conjunction conjunction)
      Returns a WHERE condition based on enabled condition models which are based on non-aggregate function columns.
      Parameters:
      conjunction - the conjunction to use in case of multiple enabled conditions
      Returns:
      the current where condition based on the state of the underlying condition models
    • having

      Condition having(Conjunction conjunction)
      Returns a HAVING condition based on enabled condition models which are based on aggregate function columns.
      Parameters:
      conjunction - the conjunction to use in case of multiple enabled conditions
      Returns:
      the current having condition based on the state of the underlying condition models
    • additionalWhere

      Value<Supplier<Condition>> additionalWhere()
      Controls the additional where condition. The condition supplier may return null in case of no condition.
      Returns:
      the Value controlling the additional where condition
    • additionalHaving

      Value<Supplier<Condition>> additionalHaving()
      Controls the additional having condition. The condition supplier may return null in case of no condition.
      Returns:
      the Value controlling the additional having condition
    • attribute

      <T> ConditionModel<Attribute<?>,T> attribute(Attribute<T> attribute)
      Returns the ConditionModel associated with the given attribute.
      Type Parameters:
      T - the column value type
      Parameters:
      attribute - the attribute for which to retrieve the ConditionModel
      Returns:
      the ConditionModel associated with attribute
      Throws:
      IllegalArgumentException - in case no condition model exists for the given attribute
    • entityConditionModel

      static EntityConditionModel entityConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider)
      Creates a new EntityConditionModel
      Parameters:
      entityType - the underlying entity type
      connectionProvider - a EntityConnectionProvider instance
      Returns:
      a new EntityConditionModel instance
    • entityConditionModel

      static EntityConditionModel entityConditionModel(EntityType entityType, EntityConnectionProvider connectionProvider, ConditionModel.Factory<Attribute<?>> conditionModelFactory)
      Creates a new EntityConditionModel
      Parameters:
      entityType - the underlying entity type
      connectionProvider - a EntityConnectionProvider instance
      conditionModelFactory - provides the column condition models for this table condition model
      Returns:
      a new EntityConditionModel instance