All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.querydsl.jdo.JDOExpressions Maven / Gradle / Ivy

There is a newer version: 5.1.0
Show newest version
/*
 * Copyright 2015, The Querydsl Team (http://www.querydsl.com/team)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.querydsl.jdo;

import com.querydsl.core.Tuple;
import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.dsl.Expressions;

/**
 * Common JDO expressions
 */
public final class JDOExpressions {

    /**
     * Create a new detached {@link JDOQuery} instance with the given projection
     *
     * @param expr projection
     * @param 
     * @return select(expr)
     */
    public static  JDOQuery select(Expression expr) {
        return new JDOQuery().select(expr);
    }

    /**
     * Create a new detached {@link JDOQuery} instance with the given projection
     *
     * @param exprs projection
     * @return select(exprs)
     */
    public static JDOQuery select(Expression... exprs) {
        return new JDOQuery().select(exprs);
    }

    /**
     * Create a new detached {@link JDOQuery} instance with the given projection
     *
     * @param expr projection
     * @param 
     * @return select(distinct expr)
     */
    public static  JDOQuery selectDistinct(Expression expr) {
        return select(expr).distinct();
    }

    /**
     * Create a new detached {@link JDOQuery} instance with the given projection
     *
     * @param exprs projection
     * @return select(distinct exprs)
     */
    public static JDOQuery selectDistinct(Expression... exprs) {
        return select(exprs).distinct();
    }


    /**
     * Create a new detached {@link JDOQuery} instance with the given projection 0
     *
     * @return select(0)
     */
    public static JDOQuery selectZero() {
        return select(Expressions.ZERO);
    }

    /**
     * Create a new detached {@link JDOQuery} instance with the projection 1
     *
     * @return select(1)
     */
    public static JDOQuery selectOne() {
        return select(Expressions.ONE);
    }

    /**
     * Create a new detached {@link JDOQuery} instance with the given projection
     *
     * @param expr projection and source
     * @param 
     * @return select(expr).from(expr)
     */
    public static  JDOQuery selectFrom(EntityPath expr) {
        return select(expr).from(expr);
    }

    private JDOExpressions() { }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy