Class CaseExpressionImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String asExpression​(org.apache.openjpa.persistence.query.AliasContext ctx)
      Get a JPQL fragment as used in WHERE clause.
      java.lang.String asJoinable​(org.apache.openjpa.persistence.query.AliasContext ctx)
      Gets the string representation in FROM clause.
      java.lang.String asProjection​(org.apache.openjpa.persistence.query.AliasContext ctx)
      Gets the string representation in SELECT projection.
      Expression elseCase​(java.lang.Class arg)
      Add else to a case expression.
      Expression elseCase​(java.lang.Enum<?> arg)
      Add else to a case expression.
      Expression elseCase​(java.lang.Number arg)
      Add else to a case expression.
      Expression elseCase​(java.lang.String arg)
      Add else to a case expression.
      Expression elseCase​(java.util.Calendar arg)
      Add else to a case expression.
      Expression elseCase​(java.util.Date arg)
      Add else to a case expression.
      Expression elseCase​(Expression arg)
      Add else to a case expression.
      java.lang.String getAliasHint​(org.apache.openjpa.persistence.query.AliasContext ctx)
      Gets the hint to be used while creating alias.
      CaseExpression then​(java.lang.Class then)
      Add a then clause to a general or simple case expression.
      CaseExpression then​(java.lang.Enum<?> then)
      Add a then clause to a general or simple case expression.
      CaseExpression then​(java.lang.Number then)
      Add a then clause to a general or simple case expression.
      CaseExpression then​(java.lang.String then)
      Add a then clause to a general or simple case expression.
      CaseExpression then​(java.util.Calendar then)
      Add a then clause to a general or simple case expression.
      CaseExpression then​(java.util.Date then)
      Add a then clause to a general or simple case expression.
      CaseExpression then​(Expression then)
      Add a then clause to a general or simple case expression.
      CaseExpression when​(java.lang.Class when)
      Add a when clause to a simple case expression.
      CaseExpression when​(java.lang.Enum<?> when)
      Add a when clause to a simple case expression.
      CaseExpression when​(java.lang.Number when)
      Add a when clause to a simple case expression.
      CaseExpression when​(java.lang.String when)
      Add a when clause to a simple case expression.
      CaseExpression when​(java.util.Calendar when)
      Add a when clause to a simple case expression.
      CaseExpression when​(java.util.Date when)
      Add a when clause to a simple case expression.
      CaseExpression when​(Expression when)
      Add a when clause to a simple case expression.
      CaseExpression when​(Predicate when)
      Add a when predicate clause to a general case expression.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CaseExpressionImpl

        public CaseExpressionImpl()
      • CaseExpressionImpl

        public CaseExpressionImpl​(java.lang.Object caseOperand)
    • Method Detail

      • elseCase

        public Expression elseCase​(Expression arg)
        Description copied from interface: CaseExpression
        Add else to a case expression. A case expression must have an else clause.
        Specified by:
        elseCase in interface CaseExpression
        Parameters:
        arg - - corresponds to the result of the case expression if the when condition is not satisfied
        Returns:
        Expression corresponding to the case expression with the added clause
      • elseCase

        public Expression elseCase​(java.lang.String arg)
        Description copied from interface: CaseExpression
        Add else to a case expression. A case expression must have an else clause.
        Specified by:
        elseCase in interface CaseExpression
        Parameters:
        arg - - corresponds to the result of the case expression if the when condition is not satisfied
        Returns:
        Expression corresponding to the case expression with the added clause
      • elseCase

        public Expression elseCase​(java.lang.Number arg)
        Description copied from interface: CaseExpression
        Add else to a case expression. A case expression must have an else clause.
        Specified by:
        elseCase in interface CaseExpression
        Parameters:
        arg - - corresponds to the result of the case expression if the when condition is not satisfied
        Returns:
        Expression corresponding to the case expression with the added clause
      • elseCase

        public Expression elseCase​(java.util.Date arg)
        Description copied from interface: CaseExpression
        Add else to a case expression. A case expression must have an else clause.
        Specified by:
        elseCase in interface CaseExpression
        Parameters:
        arg - - corresponds to the result of the case expression if the when condition is not satisfied
        Returns:
        Expression corresponding to the case expression with the added clause
      • elseCase

        public Expression elseCase​(java.util.Calendar arg)
        Description copied from interface: CaseExpression
        Add else to a case expression. A case expression must have an else clause.
        Specified by:
        elseCase in interface CaseExpression
        Parameters:
        arg - - corresponds to the result of the case expression if the when condition is not satisfied
        Returns:
        Expression corresponding to the case expression with the added clause
      • elseCase

        public Expression elseCase​(java.lang.Class arg)
        Description copied from interface: CaseExpression
        Add else to a case expression. A case expression must have an else clause.
        Specified by:
        elseCase in interface CaseExpression
        Parameters:
        arg - - corresponds to the result of the case expression if the when condition is not satisfied
        Returns:
        Expression corresponding to the case expression with the added clause
      • elseCase

        public Expression elseCase​(java.lang.Enum<?> arg)
        Description copied from interface: CaseExpression
        Add else to a case expression. A case expression must have an else clause.
        Specified by:
        elseCase in interface CaseExpression
        Parameters:
        arg - - corresponds to the result of the case expression if the when condition is not satisfied
        Returns:
        Expression corresponding to the case expression with the added clause
      • then

        public CaseExpression then​(Expression then)
        Description copied from interface: CaseExpression
        Add a then clause to a general or simple case expression. The then clause specifies the result corresponding to the immediately preceding when. Clauses are evaluated in the order added.
        Specified by:
        then in interface CaseExpression
        Parameters:
        then - - corresponds to the result of the case expression if the when is satisfied
        Returns:
        CaseExpression corresponding to the case with the added then clause
      • then

        public CaseExpression then​(java.lang.Number then)
        Description copied from interface: CaseExpression
        Add a then clause to a general or simple case expression. The then clause specifies the result corresponding to the immediately preceding when. Clauses are evaluated in the order added.
        Specified by:
        then in interface CaseExpression
        Parameters:
        then - - corresponds to the result of the case expression if the when is satisfied
        Returns:
        CaseExpression corresponding to the case with the added then clause
      • then

        public CaseExpression then​(java.lang.String then)
        Description copied from interface: CaseExpression
        Add a then clause to a general or simple case expression. The then clause specifies the result corresponding to the immediately preceding when. Clauses are evaluated in the order added.
        Specified by:
        then in interface CaseExpression
        Parameters:
        then - - corresponds to the result of the case expression if the when is satisfied
        Returns:
        CaseExpression corresponding to the case with the added then clause
      • then

        public CaseExpression then​(java.util.Date then)
        Description copied from interface: CaseExpression
        Add a then clause to a general or simple case expression. The then clause specifies the result corresponding to the immediately preceding when. Clauses are evaluated in the order added.
        Specified by:
        then in interface CaseExpression
        Parameters:
        then - - corresponds to the result of the case expression if the when is satisfied
        Returns:
        CaseExpression corresponding to the case with the added then clause
      • then

        public CaseExpression then​(java.util.Calendar then)
        Description copied from interface: CaseExpression
        Add a then clause to a general or simple case expression. The then clause specifies the result corresponding to the immediately preceding when. Clauses are evaluated in the order added.
        Specified by:
        then in interface CaseExpression
        Parameters:
        then - - corresponds to the result of the case expression if the when is satisfied
        Returns:
        CaseExpression corresponding to the case with the added then clause
      • then

        public CaseExpression then​(java.lang.Class then)
        Description copied from interface: CaseExpression
        Add a then clause to a general or simple case expression. The then clause specifies the result corresponding to the immediately preceding when. Clauses are evaluated in the order added.
        Specified by:
        then in interface CaseExpression
        Parameters:
        then - - corresponds to the result of the case expression if the when is satisfied
        Returns:
        CaseExpression corresponding to the case with the added then clause
      • then

        public CaseExpression then​(java.lang.Enum<?> then)
        Description copied from interface: CaseExpression
        Add a then clause to a general or simple case expression. The then clause specifies the result corresponding to the immediately preceding when. Clauses are evaluated in the order added.
        Specified by:
        then in interface CaseExpression
        Parameters:
        then - - corresponds to the result of the case expression if the when is satisfied
        Returns:
        CaseExpression corresponding to the case with the added then clause
      • when

        public CaseExpression when​(Predicate when)
        Description copied from interface: CaseExpression
        Add a when predicate clause to a general case expression. The when predicate must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added.
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the evaluation condition for the specific case
        Returns:
        CaseExpression corresponding to the case with the added when clause
      • when

        public CaseExpression when​(Expression when)
        Description copied from interface: CaseExpression
        Add a when clause to a simple case expression. The when case expression must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the value against which the case operand of the simple case is tested
        Returns:
        CaseExpression corresponding to the case with the added clause
      • when

        public CaseExpression when​(java.lang.Number when)
        Description copied from interface: CaseExpression
        Add a when clause to a simple case expression. The when case expression must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the value against which the case operand of the simple case is tested
        Returns:
        CaseExpression corresponding to the case with the added clause
      • when

        public CaseExpression when​(java.lang.String when)
        Description copied from interface: CaseExpression
        Add a when clause to a simple case expression. The when case expression must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the value against which the case operand of the simple case is tested
        Returns:
        CaseExpression corresponding to the case with the added clause
      • when

        public CaseExpression when​(java.util.Date when)
        Description copied from interface: CaseExpression
        Add a when clause to a simple case expression. The when case expression must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the value against which the case operand of the simple case is tested
        Returns:
        CaseExpression corresponding to the case with the added clause
      • when

        public CaseExpression when​(java.util.Calendar when)
        Description copied from interface: CaseExpression
        Add a when clause to a simple case expression. The when case expression must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the value against which the case operand of the simple case is tested
        Returns:
        CaseExpression corresponding to the case with the added clause
      • when

        public CaseExpression when​(java.lang.Class when)
        Description copied from interface: CaseExpression
        Add a when clause to a simple case expression. The when case expression must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the value against which the case operand of the simple case is tested
        Returns:
        CaseExpression corresponding to the case with the added clause
      • when

        public CaseExpression when​(java.lang.Enum<?> when)
        Description copied from interface: CaseExpression
        Add a when clause to a simple case expression. The when case expression must be followed by the corresponding then case expression that specifies the result of the specific case. Clauses are evaluated in the order added
        Specified by:
        when in interface CaseExpression
        Parameters:
        when - - corresponds to the value against which the case operand of the simple case is tested
        Returns:
        CaseExpression corresponding to the case with the added clause
      • asExpression

        public java.lang.String asExpression​(org.apache.openjpa.persistence.query.AliasContext ctx)
        Description copied from interface: Visitable
        Get a JPQL fragment as used in WHERE clause.
        Specified by:
        asExpression in interface Visitable
      • asProjection

        public java.lang.String asProjection​(org.apache.openjpa.persistence.query.AliasContext ctx)
        Description copied from interface: Visitable
        Gets the string representation in SELECT projection.
        Specified by:
        asProjection in interface Visitable
      • asJoinable

        public java.lang.String asJoinable​(org.apache.openjpa.persistence.query.AliasContext ctx)
        Description copied from interface: Visitable
        Gets the string representation in FROM clause.
        Specified by:
        asJoinable in interface Visitable
      • getAliasHint

        public java.lang.String getAliasHint​(org.apache.openjpa.persistence.query.AliasContext ctx)
        Description copied from interface: Visitable
        Gets the hint to be used while creating alias.
        Specified by:
        getAliasHint in interface Visitable