org.eclipse.persistence.jpa.jpql.tools.model.query.DeclarationStateObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eclipselink Show documentation
Show all versions of eclipselink Show documentation
EclipseLink build based upon Git transaction 180e602
/*******************************************************************************
* Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation
*
******************************************************************************/
package org.eclipse.persistence.jpa.jpql.tools.model.query;
import org.eclipse.persistence.jpa.jpql.tools.spi.IManagedType;
import org.eclipse.persistence.jpa.jpql.utility.iterable.ListIterable;
/**
* This defines the declaration portion of a query, which is the FROM
clause
* of a query.
*
* @see FromClauseStateObject
* @see SimpleFromClauseStateObject
* @see DeleteClauseStateObject
* @see UpdateClauseStateObject
*
* @version 2.5
* @since 2.4
* @author Pascal Filion
*/
public interface DeclarationStateObject extends StateObject {
/**
* Returns the list of declarations declared in the declaration clause of the current query.
*
* @return The list of {@link VariableDeclarationStateObject} that define the domain of the query
*/
ListIterable declarations();
/**
* Returns the {@link IManagedType} for the given identification variable. If the declaration is
* for a subquery and there is no managed type associated with the identification then the search
* will traverse up the query hierarchy.
*
* SELECT e FROM Department d JOIN KEY(d.employees).addresses a
* In the above query, the managed type associated with the identification variable:
*
* - d is "Department"
*
- a is "Address"
*
*
* @param stateObject The {@link StateObject} that should be an simple identification variable or
* an encapsulated identification variable with the identifier KEY
or
* VALUE
* @return The {@link IManagedType} representing the domain object declared by the given
* identification variable
* @see #getManagedType(StateObject)
*/
IManagedType findManagedType(StateObject stateObject);
/**
* Returns the {@link IManagedType} for the given identification variable. The search does not
* traverse up the query hierarchy if this declaration is for a subquery.
*
* SELECT e FROM Department d JOIN KEY(d.employees).addresses a
* In the above query, the managed type associated with the identification variable:
*
* - d is "Department"
*
- a is "Address"
*
*
* @param stateObject The {@link StateObject} that should be an simple identification variable or
* an encapsulated identification variable with the identifier KEY
or
* VALUE
* @return The {@link IManagedType} representing the domain object declared by the given
* identification variable
* @see #findManagedType(StateObject)
*/
IManagedType getManagedType(StateObject stateObject);
}