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

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

Go to download

Hibernate developmental JSR 317 (Java Persistence API 2.0) contracts. Used to allow incremental implementation of features on the way to full JPA 2.0 support.

The newest version!
// $Id: Path.java 17038 2009-07-08 10:58:24Z epbernard $
// EJB3 Specification Copyright 2004-2009 Sun Microsystems, Inc.
package javax.persistence.criteria;

import javax.persistence.metamodel.Bindable;
import javax.persistence.metamodel.MapAttribute;
import javax.persistence.metamodel.PluralAttribute;
import javax.persistence.metamodel.SingularAttribute;

/**
 * Represents a simple or compound attribute path from a
 * bound type or collection, and is a "primitive" expression.
 * @param   Type referenced by the path
 */
public interface Path extends Expression {

    /**
     * Return the bindable object that corresponds to the
     * path expression.
     * @return bindable object corresponding to the path
     */
    Bindable getModel();

    /**
     *  Return the parent "node" in the path or null if no parent.
     *  @return parent
     */
    Path getParentPath();

    /**
     *  Return the path corresponding to the referenced
     *  single-valued attribute.
     *  @param attribute single-valued attribute
     *  @return path corresponding to the referenced attribute
     */
     Path get(SingularAttribute attribute);

    /**
     *  Return the path corresponding to the referenced
     *  collection-valued attribute.
     *  @param collection collection-valued attribute
     *  @return expression corresponding to the referenced attribute
     */
    > Expression get(PluralAttribute collection);

    /**
     *  Return the path corresponding to the referenced
     *  map-valued attribute.
     *  @param map map-valued attribute
     *  @return expression corresponding to the referenced attribute
     */
    > Expression get(MapAttribute map);

    /**
     *  Return an expression corresponding to the type of the path.
     *  @return expression corresponding to the type of the path
     */
    Expression> type();


    //String-based:

    /**
     *  Return the path corresponding to the referenced
     *  attribute.
     *  @param attributeName  name of the attribute
     *  @return path corresponding to the referenced attribute
     *  @throws IllegalStateException if invoked on a path that
     *          corresponds to a basic type
     *  @throws IllegalArgumentException if attribute of the given
     *          name does not otherwise exist
     */
     Path get(String attributeName);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy