Package javax.persistence.criteria

Examples of javax.persistence.criteria.Expression


     */
    public <T> Expression<T> function(String name, Class<T> type, Expression<?>... args){
        if (args != null && args.length > 0){
        List<org.eclipse.persistence.expressions.Expression> params = new ArrayList<org.eclipse.persistence.expressions.Expression>();
        for (int index = 1; index < args.length; ++index){
            Expression x = args[index];
            if (((InternalSelection)x).isFrom()){
                ((FromImpl)x).isLeaf = false;
            }
            params.add(((InternalSelection)x).getCurrentNode());
        }
View Full Code Here


              // converting to the column(s) associated with the entity's ID in the rendered SQL.  However, some DBs don't support
              // the multiple columns that would end up here for entities with composite IDs.  So, since we modify the query to
              // instead specify star since that's functionally equivalent and supported by all DBs.
          List<Expression<?>> argExprs = getArgumentExpressions();
          if (argExprs.size() == 1) {
                  Expression argExpr = argExprs.get(0);
                  if (argExpr instanceof Root<?>) {
                      Root<?> root = (Root<?>)argExpr;
                      if (!root.getModel().hasSingleIdAttribute()) {
                          buffer.append('*');
                          return;
View Full Code Here

                    }
                    this.builder.delete(this.builder.toString().lastIndexOf("OR"), this.builder.length());
                }
                else if (expr.getClass().isAssignableFrom(BetweenPredicate.class))
                {
                    Expression btExpression = ((BetweenPredicate) expr).getExpression();
                    appendBTValueClause(alias, btExpression, (BetweenPredicate) expr);
                }

            }
View Full Code Here

     * @param y
     *            expression
     * @return modulus
     */
    public Expression<Integer> mod(Integer x, Expression<Integer> y){
        Expression xExp = literal(x);
        return new FunctionExpressionImpl(this.metamodel, ClassConstants.INTEGER, ExpressionMath.mod(((InternalSelection)xExp).getCurrentNode(),((InternalSelection)y).getCurrentNode()), buildList(xExp,y), "mod");
    }
View Full Code Here

     */
    public <T> Expression<T> function(String name, Class<T> type, Expression<?>... args){
        if (args != null && args.length > 0){
        Vector<org.eclipse.persistence.expressions.Expression> params = new Vector<org.eclipse.persistence.expressions.Expression>();
        for (int index = 1; index < args.length; ++index){
            Expression x = args[index];
            if (((InternalSelection)x).isFrom()){
                ((FromImpl)x).isLeaf = false;
            }
            params.add(((InternalSelection)x).getCurrentNode());
        }
View Full Code Here

     * @param y
     *            expression
     * @return modulus
     */
    public Expression<Integer> mod(Integer x, Expression<Integer> y){
        Expression xExp = internalLiteral(x);
        return new FunctionExpressionImpl(this.metamodel, ClassConstants.INTEGER, ExpressionMath.mod(((InternalSelection)xExp).getCurrentNode(),((InternalSelection)y).getCurrentNode()), buildList(xExp,y), "mod");
    }
View Full Code Here

     */
    public <T> Expression<T> function(String name, Class<T> type, Expression<?>... args){
        if (args != null && args.length > 0){
        List<org.eclipse.persistence.expressions.Expression> params = new ArrayList<org.eclipse.persistence.expressions.Expression>();
        for (int index = 1; index < args.length; ++index){
            Expression x = args[index];
            params.add(((InternalSelection)x).getCurrentNode());
        }
       
        return new FunctionExpressionImpl<T>(metamodel, type, ((InternalSelection)args[0]).getCurrentNode().getFunctionWithArguments(name, params), buildList(args), name);
        }else{
View Full Code Here

TOP

Related Classes of javax.persistence.criteria.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.