org.hibernate.ejb.criteria.path
Class AbstractFromImpl<Z,X>

java.lang.Object
  extended by org.hibernate.ejb.criteria.AbstractNode
      extended by org.hibernate.ejb.criteria.expression.AbstractTupleElement<X>
          extended by org.hibernate.ejb.criteria.expression.SelectionImpl<T>
              extended by org.hibernate.ejb.criteria.expression.ExpressionImpl<X>
                  extended by org.hibernate.ejb.criteria.path.AbstractPathImpl<X>
                      extended by org.hibernate.ejb.criteria.path.AbstractFromImpl<Z,X>
All Implemented Interfaces:
Serializable, javax.persistence.criteria.Expression<X>, javax.persistence.criteria.FetchParent<Z,X>, javax.persistence.criteria.From<Z,X>, javax.persistence.criteria.Path<X>, javax.persistence.criteria.Selection<X>, TupleElement<X>, ExpressionImplementor<X>, FromImplementor<Z,X>, ParameterContainer, PathImplementor<X>, PathSource<X>, Renderable, SelectionImplementor<X>, TupleElementImplementor<X>
Direct Known Subclasses:
AbstractJoinImpl, RootImpl

public abstract class AbstractFromImpl<Z,X>
extends AbstractPathImpl<X>
implements javax.persistence.criteria.From<Z,X>, FromImplementor<Z,X>, Serializable

Convenience base class for various From implementors.

Author:
Steve Ebersole
See Also:
Serialized Form

Nested Class Summary
protected  class AbstractFromImpl.BasicJoinScope
           
protected  class AbstractFromImpl.CorrelationJoinScope
           
static interface AbstractFromImpl.JoinScope<X>
          Helper contract used to define who/what keeps track of joins and fetches made from this FROM.
 
Nested classes/interfaces inherited from interface org.hibernate.ejb.criteria.ParameterContainer
ParameterContainer.Helper
 
Field Summary
static javax.persistence.criteria.JoinType DEFAULT_JOIN_TYPE
           
 
Constructor Summary
AbstractFromImpl(CriteriaBuilderImpl criteriaBuilder, Class<X> javaType)
           
AbstractFromImpl(CriteriaBuilderImpl criteriaBuilder, Class<X> javaType, PathSource pathSource)
           
 
Method Summary
protected  boolean canBeDereferenced()
          
protected  boolean canBeFetchSource()
           
protected abstract  boolean canBeJoinSource()
           
 FromImplementor<Z,X> correlateTo(CriteriaSubqueryImpl subquery)
          
protected abstract  FromImplementor<Z,X> createCorrelationDelegate()
           
<Y> javax.persistence.criteria.Fetch<X,Y>
fetch(javax.persistence.metamodel.PluralAttribute<? super X,?,Y> pluralAttribute)
           
<Y> javax.persistence.criteria.Fetch<X,Y>
fetch(javax.persistence.metamodel.PluralAttribute<? super X,?,Y> pluralAttribute, javax.persistence.criteria.JoinType jt)
           
<Y> javax.persistence.criteria.Fetch<X,Y>
fetch(javax.persistence.metamodel.SingularAttribute<? super X,Y> singularAttribute)
           
<Y> javax.persistence.criteria.Fetch<X,Y>
fetch(javax.persistence.metamodel.SingularAttribute<? super X,Y> attribute, javax.persistence.criteria.JoinType jt)
           
<X,Y> javax.persistence.criteria.Fetch<X,Y>
fetch(String attributeName)
           
<X,Y> javax.persistence.criteria.Fetch<X,Y>
fetch(String attributeName, javax.persistence.criteria.JoinType jt)
           
 String getAlias()
          
 javax.persistence.metamodel.Attribute<?,?> getAttribute()
          Retrieve reference to the attribute this path represents.
 FromImplementor<Z,X> getCorrelationParent()
          
 Set<javax.persistence.criteria.Fetch<X,?>> getFetches()
          
 Set<javax.persistence.criteria.Join<X,?>> getJoins()
          
 javax.persistence.criteria.From<?,Z> getParent()
          
 String getPathIdentifier()
          Get the string representation of this path as a navigation from one of the queries identification variables
 PathSource<Z> getPathSource()
           
 boolean isCorrelated()
          
<Y> javax.persistence.criteria.CollectionJoin<X,Y>
join(javax.persistence.metamodel.CollectionAttribute<? super X,Y> collection)
          
<Y> javax.persistence.criteria.CollectionJoin<X,Y>
join(javax.persistence.metamodel.CollectionAttribute<? super X,Y> collection, javax.persistence.criteria.JoinType jt)
          
<Y> javax.persistence.criteria.ListJoin<X,Y>
join(javax.persistence.metamodel.ListAttribute<? super X,Y> list)
          
<Y> javax.persistence.criteria.ListJoin<X,Y>
join(javax.persistence.metamodel.ListAttribute<? super X,Y> list, javax.persistence.criteria.JoinType jt)
          
<K,V> javax.persistence.criteria.MapJoin<X,K,V>
join(javax.persistence.metamodel.MapAttribute<? super X,K,V> map)
          
<K,V> javax.persistence.criteria.MapJoin<X,K,V>
join(javax.persistence.metamodel.MapAttribute<? super X,K,V> map, javax.persistence.criteria.JoinType jt)
          
<Y> javax.persistence.criteria.SetJoin<X,Y>
join(javax.persistence.metamodel.SetAttribute<? super X,Y> set)
          
<Y> javax.persistence.criteria.SetJoin<X,Y>
join(javax.persistence.metamodel.SetAttribute<? super X,Y> set, javax.persistence.criteria.JoinType jt)
          
<Y> javax.persistence.criteria.Join<X,Y>
join(javax.persistence.metamodel.SingularAttribute<? super X,Y> singularAttribute)
          
<Y> javax.persistence.criteria.Join<X,Y>
join(javax.persistence.metamodel.SingularAttribute<? super X,Y> attribute, javax.persistence.criteria.JoinType jt)
          
<X,Y> javax.persistence.criteria.Join<X,Y>
join(String attributeName)
          
<X,Y> javax.persistence.criteria.Join<X,Y>
join(String attributeName, javax.persistence.criteria.JoinType jt)
          
<X,Y> javax.persistence.criteria.CollectionJoin<X,Y>
joinCollection(String attributeName)
          
<X,Y> javax.persistence.criteria.CollectionJoin<X,Y>
joinCollection(String attributeName, javax.persistence.criteria.JoinType jt)
          
<X,Y> javax.persistence.criteria.ListJoin<X,Y>
joinList(String attributeName)
          
<X,Y> javax.persistence.criteria.ListJoin<X,Y>
joinList(String attributeName, javax.persistence.criteria.JoinType jt)
          
<X,K,V> javax.persistence.criteria.MapJoin<X,K,V>
joinMap(String attributeName)
          
<X,K,V> javax.persistence.criteria.MapJoin<X,K,V>
joinMap(String attributeName, javax.persistence.criteria.JoinType jt)
          
<X,Y> javax.persistence.criteria.SetJoin<X,Y>
joinSet(String attributeName)
          
<X,Y> javax.persistence.criteria.SetJoin<X,Y>
joinSet(String attributeName, javax.persistence.criteria.JoinType jt)
          
protected  javax.persistence.metamodel.Attribute<X,?> locateAttributeInternal(String name)
          Get the attribute by name from the underlying model.
protected  javax.persistence.metamodel.ManagedType<? super X> locateManagedType()
           
 void prepareAlias(CriteriaQueryCompiler.RenderingContext renderingContext)
          
 void prepareCorrelationDelegate(FromImplementor<Z,X> parent)
           
 String render(CriteriaQueryCompiler.RenderingContext renderingContext)
          
 String renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext)
          
 
Methods inherited from class org.hibernate.ejb.criteria.path.AbstractPathImpl
get, get, get, get, getParentPath, illegalDereference, locateAttribute, registerAttributePath, registerParameters, resolveCachedAttributePath, type, unknownAttribute
 
Methods inherited from class org.hibernate.ejb.criteria.expression.ExpressionImpl
as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, in, in, in, in, isNotNull, isNull
 
Methods inherited from class org.hibernate.ejb.criteria.expression.SelectionImpl
alias, getCompoundSelectionItems, getValueHandlers, isCompoundSelection
 
Methods inherited from class org.hibernate.ejb.criteria.expression.AbstractTupleElement
forceConversion, getJavaType, getValueHandler, resetJavaType, setAlias
 
Methods inherited from class org.hibernate.ejb.criteria.AbstractNode
criteriaBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.ejb.criteria.FromImplementor
renderTableExpression
 
Methods inherited from interface org.hibernate.ejb.criteria.ExpressionImplementor
asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString
 
Methods inherited from interface org.hibernate.ejb.criteria.SelectionImplementor
getValueHandlers
 
Methods inherited from interface org.hibernate.ejb.criteria.TupleElementImplementor
getValueHandler
 
Methods inherited from interface javax.persistence.criteria.Path
get, get, get, get, getModel, getParentPath, type
 
Methods inherited from interface javax.persistence.criteria.Expression
as, in, in, in, in, isNotNull, isNull
 
Methods inherited from interface javax.persistence.criteria.Selection
alias, getCompoundSelectionItems, isCompoundSelection
 
Methods inherited from interface javax.persistence.TupleElement
getJavaType
 

Field Detail

DEFAULT_JOIN_TYPE

public static final javax.persistence.criteria.JoinType DEFAULT_JOIN_TYPE
Constructor Detail

AbstractFromImpl

public AbstractFromImpl(CriteriaBuilderImpl criteriaBuilder,
                        Class<X> javaType)

AbstractFromImpl

public AbstractFromImpl(CriteriaBuilderImpl criteriaBuilder,
                        Class<X> javaType,
                        PathSource pathSource)
Method Detail

getPathSource

public PathSource<Z> getPathSource()
Overrides:
getPathSource in class AbstractPathImpl<X>

getPathIdentifier

public String getPathIdentifier()
Description copied from class: AbstractPathImpl
Get the string representation of this path as a navigation from one of the queries identification variables

Specified by:
getPathIdentifier in interface PathSource<X>
Overrides:
getPathIdentifier in class AbstractPathImpl<X>
Returns:
The path's identifier.

canBeDereferenced

protected boolean canBeDereferenced()

Specified by:
canBeDereferenced in class AbstractPathImpl<X>

prepareAlias

public void prepareAlias(CriteriaQueryCompiler.RenderingContext renderingContext)

Specified by:
prepareAlias in interface FromImplementor<Z,X>
Specified by:
prepareAlias in interface PathSource<X>
Overrides:
prepareAlias in class AbstractPathImpl<X>

renderProjection

public String renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext)
Description copied from class: AbstractPathImpl

Specified by:
renderProjection in interface Renderable
Overrides:
renderProjection in class AbstractPathImpl<X>

render

public String render(CriteriaQueryCompiler.RenderingContext renderingContext)
Description copied from class: AbstractPathImpl

Specified by:
render in interface Renderable
Overrides:
render in class AbstractPathImpl<X>

getAttribute

public javax.persistence.metamodel.Attribute<?,?> getAttribute()
Retrieve reference to the attribute this path represents.

Specified by:
getAttribute in interface PathImplementor<X>
Returns:
The metamodel attribute.

getParent

public javax.persistence.criteria.From<?,Z> getParent()


locateAttributeInternal

protected javax.persistence.metamodel.Attribute<X,?> locateAttributeInternal(String name)
Get the attribute by name from the underlying model. This allows subclasses to define exactly how the attribute is derived. Called from AbstractPathImpl.locateAttribute(java.lang.String) which also applies nullness checking for proper error reporting.

Specified by:
locateAttributeInternal in class AbstractPathImpl<X>
Parameters:
name - The name of the attribute to locate
Returns:
The attribute; may be null.

locateManagedType

protected javax.persistence.metamodel.ManagedType<? super X> locateManagedType()

isCorrelated

public boolean isCorrelated()

Specified by:
isCorrelated in interface javax.persistence.criteria.From<Z,X>

getCorrelationParent

public FromImplementor<Z,X> getCorrelationParent()

Specified by:
getCorrelationParent in interface javax.persistence.criteria.From<Z,X>
Specified by:
getCorrelationParent in interface FromImplementor<Z,X>

correlateTo

public FromImplementor<Z,X> correlateTo(CriteriaSubqueryImpl subquery)

Specified by:
correlateTo in interface FromImplementor<Z,X>

createCorrelationDelegate

protected abstract FromImplementor<Z,X> createCorrelationDelegate()

prepareCorrelationDelegate

public void prepareCorrelationDelegate(FromImplementor<Z,X> parent)
Specified by:
prepareCorrelationDelegate in interface FromImplementor<Z,X>

getAlias

public String getAlias()
Description copied from class: AbstractTupleElement

Specified by:
getAlias in interface TupleElement<X>
Overrides:
getAlias in class AbstractTupleElement<X>

canBeJoinSource

protected abstract boolean canBeJoinSource()

getJoins

public Set<javax.persistence.criteria.Join<X,?>> getJoins()

Specified by:
getJoins in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.Join<X,Y> join(javax.persistence.metamodel.SingularAttribute<? super X,Y> singularAttribute)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.Join<X,Y> join(javax.persistence.metamodel.SingularAttribute<? super X,Y> attribute,
                                                     javax.persistence.criteria.JoinType jt)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.CollectionJoin<X,Y> join(javax.persistence.metamodel.CollectionAttribute<? super X,Y> collection)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.CollectionJoin<X,Y> join(javax.persistence.metamodel.CollectionAttribute<? super X,Y> collection,
                                                               javax.persistence.criteria.JoinType jt)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.SetJoin<X,Y> join(javax.persistence.metamodel.SetAttribute<? super X,Y> set)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.SetJoin<X,Y> join(javax.persistence.metamodel.SetAttribute<? super X,Y> set,
                                                        javax.persistence.criteria.JoinType jt)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.ListJoin<X,Y> join(javax.persistence.metamodel.ListAttribute<? super X,Y> list)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <Y> javax.persistence.criteria.ListJoin<X,Y> join(javax.persistence.metamodel.ListAttribute<? super X,Y> list,
                                                         javax.persistence.criteria.JoinType jt)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <K,V> javax.persistence.criteria.MapJoin<X,K,V> join(javax.persistence.metamodel.MapAttribute<? super X,K,V> map)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <K,V> javax.persistence.criteria.MapJoin<X,K,V> join(javax.persistence.metamodel.MapAttribute<? super X,K,V> map,
                                                            javax.persistence.criteria.JoinType jt)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <X,Y> javax.persistence.criteria.Join<X,Y> join(String attributeName)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

join

public <X,Y> javax.persistence.criteria.Join<X,Y> join(String attributeName,
                                                       javax.persistence.criteria.JoinType jt)

Specified by:
join in interface javax.persistence.criteria.From<Z,X>

joinCollection

public <X,Y> javax.persistence.criteria.CollectionJoin<X,Y> joinCollection(String attributeName)

Specified by:
joinCollection in interface javax.persistence.criteria.From<Z,X>

joinCollection

public <X,Y> javax.persistence.criteria.CollectionJoin<X,Y> joinCollection(String attributeName,
                                                                           javax.persistence.criteria.JoinType jt)

Specified by:
joinCollection in interface javax.persistence.criteria.From<Z,X>

joinSet

public <X,Y> javax.persistence.criteria.SetJoin<X,Y> joinSet(String attributeName)

Specified by:
joinSet in interface javax.persistence.criteria.From<Z,X>

joinSet

public <X,Y> javax.persistence.criteria.SetJoin<X,Y> joinSet(String attributeName,
                                                             javax.persistence.criteria.JoinType jt)

Specified by:
joinSet in interface javax.persistence.criteria.From<Z,X>

joinList

public <X,Y> javax.persistence.criteria.ListJoin<X,Y> joinList(String attributeName)

Specified by:
joinList in interface javax.persistence.criteria.From<Z,X>

joinList

public <X,Y> javax.persistence.criteria.ListJoin<X,Y> joinList(String attributeName,
                                                               javax.persistence.criteria.JoinType jt)

Specified by:
joinList in interface javax.persistence.criteria.From<Z,X>

joinMap

public <X,K,V> javax.persistence.criteria.MapJoin<X,K,V> joinMap(String attributeName)

Specified by:
joinMap in interface javax.persistence.criteria.From<Z,X>

joinMap

public <X,K,V> javax.persistence.criteria.MapJoin<X,K,V> joinMap(String attributeName,
                                                                 javax.persistence.criteria.JoinType jt)

Specified by:
joinMap in interface javax.persistence.criteria.From<Z,X>

canBeFetchSource

protected boolean canBeFetchSource()

getFetches

public Set<javax.persistence.criteria.Fetch<X,?>> getFetches()

Specified by:
getFetches in interface javax.persistence.criteria.FetchParent<Z,X>

fetch

public <Y> javax.persistence.criteria.Fetch<X,Y> fetch(javax.persistence.metamodel.SingularAttribute<? super X,Y> singularAttribute)
Specified by:
fetch in interface javax.persistence.criteria.FetchParent<Z,X>

fetch

public <Y> javax.persistence.criteria.Fetch<X,Y> fetch(javax.persistence.metamodel.SingularAttribute<? super X,Y> attribute,
                                                       javax.persistence.criteria.JoinType jt)
Specified by:
fetch in interface javax.persistence.criteria.FetchParent<Z,X>

fetch

public <Y> javax.persistence.criteria.Fetch<X,Y> fetch(javax.persistence.metamodel.PluralAttribute<? super X,?,Y> pluralAttribute)
Specified by:
fetch in interface javax.persistence.criteria.FetchParent<Z,X>

fetch

public <Y> javax.persistence.criteria.Fetch<X,Y> fetch(javax.persistence.metamodel.PluralAttribute<? super X,?,Y> pluralAttribute,
                                                       javax.persistence.criteria.JoinType jt)
Specified by:
fetch in interface javax.persistence.criteria.FetchParent<Z,X>

fetch

public <X,Y> javax.persistence.criteria.Fetch<X,Y> fetch(String attributeName)
Specified by:
fetch in interface javax.persistence.criteria.FetchParent<Z,X>

fetch

public <X,Y> javax.persistence.criteria.Fetch<X,Y> fetch(String attributeName,
                                                         javax.persistence.criteria.JoinType jt)
Specified by:
fetch in interface javax.persistence.criteria.FetchParent<Z,X>


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.