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

javax.persistence.criteria.Expression Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2010 Bull S.A.S.
 *
 * 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 javax.persistence.criteria;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * Type for query expressions.
 * @param  the type of the expression
 * @see JPA 2.0 specification
 * @author Florent Benoit
 * @since JPA 2.0 version.
 */
public interface Expression extends Selection {
    /**
     * Create a predicate to test whether the expression is null.
     * @return predicate testing whether the expression is null
     */
    Predicate isNull();
    /**
     * Create a predicate to test whether the expression is
     * not null.
     * @return predicate testing whether the expression is not null
     */
    Predicate isNotNull();
    /**
     * Create a predicate to test whether the expression is a member
     * of the argument list.
     * @param values values to be tested against
     * @return predicate testing for membership
     */
    Predicate in(Object... values);
    /**
     * Create a predicate to test whether the expression is a member
     * of the argument list.
     * @param values expressions to be tested against
     * @return predicate testing for membership
     */
    Predicate in(Expression... values);
    /**
     * Create a predicate to test whether the expression is a member
     * of the collection.
     * @param values collection of values to be tested against
     * @return predicate testing for membership
     */
    Predicate in(Collection values);
    /**
     * Create a predicate to test whether the expression is a member
     * of the collection.
     * @param values expression corresponding to collection to be
     *        tested against
     * @return predicate testing for membership
     */
    Predicate in(Expression> values);

    /**
     * Perform a typecast upon the expression, returning a new
     * expression object.
     * This method does not cause type conversion:
     * the runtime type is not changed.
     * Warning: may result in a runtime failure.
     * @param type intended type of the expression
     * @return new expression of the given type
     */
     Expression as(Class type);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy