Class Conditions

    • Method Detail

      • entityCondition

        public static EntityCondition entityCondition​(Entity.Key key)
        Creates a EntityCondition instance specifying the entity of the type identified by key
        Parameters:
        key - the primary key
        Returns:
        a condition specifying the entity with the given primary key
      • entityCondition

        public static EntityCondition entityCondition​(String entityId,
                                                      Condition condition)
        Creates a EntityCondition instance specifying the entities of the type identified by key, using the given Condition
        Parameters:
        entityId - the entity ID
        condition - the column condition
        Returns:
        a condition based on the given column condition
      • entityCondition

        public static EntityCondition entityCondition​(List<Entity.Key> keys)
        Creates a condition based on the given primary keys, it is assumed they are all of the same type
        Parameters:
        keys - the primary keys
        Returns:
        a condition specifying the entities having the given primary keys
      • entityCondition

        public static EntityCondition entityCondition​(String entityId)
        Creates a EntitySelectCondition instance specifying all entities of the type identified by entityId
        Parameters:
        entityId - the entity ID
        Returns:
        a condition specifying all entities of the given type
      • entityCondition

        public static EntityCondition entityCondition​(String entityId,
                                                      String propertyId,
                                                      ConditionType conditionType,
                                                      Object value)
        Creates a EntityCondition instance for specifying entities of the type identified by entityId with a where condition based on the property identified by propertyId, the operators based on conditionType and value. Note that value may be a single value, a Collection of values or null.
        Parameters:
        entityId - the entity ID
        propertyId - the property ID
        conditionType - the search type
        value - the condition value, can be a Collection of values
        Returns:
        a condition based on the given value
      • entitySelectCondition

        public static EntitySelectCondition entitySelectCondition​(Entity.Key key)
        Creates a EntitySelectCondition instance for selecting the entity with the given key
        Parameters:
        key - the key
        Returns:
        a select condition based on the given key
      • entitySelectCondition

        public static EntitySelectCondition entitySelectCondition​(List<Entity.Key> keys)
        Creates a EntitySelectCondition instance for selecting the entities with the given keys, it is assumed they are all of the same type
        Parameters:
        keys - the keys
        Returns:
        a select condition based on the given keys
      • entitySelectCondition

        public static EntitySelectCondition entitySelectCondition​(String entityId)
        Creates a EntitySelectCondition instance for selecting all entities of the type identified by entityId
        Parameters:
        entityId - the entity ID
        Returns:
        a select condition encompassing all entities of the given type
      • entitySelectCondition

        public static EntitySelectCondition entitySelectCondition​(String entityId,
                                                                  Condition condition)
        Creates a EntitySelectCondition instance for selecting entities of the type identified by entityId, using the given Condition
        Parameters:
        entityId - the entity ID
        condition - the column condition
        Returns:
        a select condition based on the given column condition
      • entitySelectCondition

        public static EntitySelectCondition entitySelectCondition​(String entityId,
                                                                  String propertyId,
                                                                  ConditionType conditionType,
                                                                  Object value)
        Creates a EntitySelectCondition instance for selecting entities of the type identified by entityId with a where condition based on the property identified by propertyId, the operators based on conditionType and value. Note that value may be a single value, a Collection of values or null.
        Parameters:
        entityId - the entity ID
        propertyId - the property ID
        conditionType - the condition type
        value - the condition value, can be a Collection of values
        Returns:
        a select condition based on the given value
      • entityUpdateCondition

        public static EntityUpdateCondition entityUpdateCondition​(String entityId)
        Creates a EntityUpdateCondition instance for updating all entities of the type identified by entityId
        Parameters:
        entityId - the entity ID
        Returns:
        an update condition encompassing all entities of the given type
      • entityUpdateCondition

        public static EntityUpdateCondition entityUpdateCondition​(String entityId,
                                                                  String propertyId,
                                                                  ConditionType conditionType,
                                                                  Object value)
        Creates a EntityUpdateCondition instance for updating entities of the type identified by entityId with a where condition based on the property identified by propertyId, the operators based on conditionType and value. Note that value may be a single value, a Collection of values or null.
        Parameters:
        entityId - the entity ID
        propertyId - the property ID
        conditionType - the condition type
        value - the condition value, can be a Collection of values
        Returns:
        an update condition based on the given value
      • entityUpdateCondition

        public static EntityUpdateCondition entityUpdateCondition​(String entityId,
                                                                  Condition condition)
        Creates a EntityUpdateCondition instance for updating entities of the type identified by entityId, using the given Condition
        Parameters:
        entityId - the entity ID
        condition - the column condition
        Returns:
        an update condition based on the given column condition
      • conditionSet

        public static Condition.Set conditionSet​(Conjunction conjunction,
                                                 Condition... conditions)
        Initializes a new Condition.Set instance
        Parameters:
        conjunction - the Conjunction to use
        conditions - the Condition objects to be included in this set
        Returns:
        a new Condition.Set instance
      • propertyCondition

        public static PropertyCondition propertyCondition​(String propertyId,
                                                          ConditionType conditionType,
                                                          Object value)
        Creates a Condition for the given property, with the operator specified by the conditionType and value. Note that value may be a single value, a Collection of values or null.
        Parameters:
        propertyId - the property
        conditionType - the search type
        value - the condition value, can be a Collection of values
        Returns:
        a property condition based on the given value
      • whereCondition

        public static WhereCondition whereCondition​(EntityCondition entityCondition,
                                                    EntityDefinition entityDefinition)
        Creates a WhereCondition for the given EntityCondition.
        Parameters:
        entityCondition - the condition
        entityDefinition - the definition
        Returns:
        a WhereCondition
      • expand

        public static Condition expand​(Condition condition,
                                       EntityDefinition definition)
        Expands the given condition, that is, transforms property conditions based on foreign key properties into column property conditions
        Parameters:
        condition - the condition
        definition - the entity definition
        Returns:
        an expanded Condition
      • createCompositeKeyCondition

        public static Condition createCompositeKeyCondition​(List<Entity.Key> keys,
                                                            List<ColumnProperty> properties,
                                                            ConditionType conditionType)
        Creates a composite condition from the given keys, referencing the given properties
        Parameters:
        keys - the keys
        properties - the key properties
        conditionType - the condition type
        Returns:
        a Condition referencing the given keys