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, Expression<X>, FetchParent<Z,X>, From<Z,X>, Path<X>, 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 From<Z,X>, FromImplementor<Z,X>, Serializable

Convenience base class for various From implementors.

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 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> Fetch<X,Y>
fetch(PluralAttribute<? super X,?,Y> pluralAttribute)
           
<Y> Fetch<X,Y>
fetch(PluralAttribute<? super X,?,Y> pluralAttribute, JoinType jt)
           
<Y> Fetch<X,Y>
fetch(SingularAttribute<? super X,Y> singularAttribute)
           
<Y> Fetch<X,Y>
fetch(SingularAttribute<? super X,Y> attribute, JoinType jt)
           
<X,Y> Fetch<X,Y>
fetch(String attributeName)
           
<X,Y> Fetch<X,Y>
fetch(String attributeName, JoinType jt)
           
 String getAlias()
          
 Attribute<?,?> getAttribute()
          Retrieve reference to the attribute this path represents.
 FromImplementor<Z,X> getCorrelationParent()
           
 Set<Fetch<X,?>> getFetches()
           
 Set<Join<X,?>> getJoins()
           
 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> CollectionJoin<X,Y>
join(CollectionAttribute<? super X,Y> collection)
           
<Y> CollectionJoin<X,Y>
join(CollectionAttribute<? super X,Y> collection, JoinType jt)
           
<Y> ListJoin<X,Y>
join(ListAttribute<? super X,Y> list)
           
<Y> ListJoin<X,Y>
join(ListAttribute<? super X,Y> list, JoinType jt)
           
<K,V> MapJoin<X,K,V>
join(MapAttribute<? super X,K,V> map)
           
<K,V> MapJoin<X,K,V>
join(MapAttribute<? super X,K,V> map, JoinType jt)
           
<Y> SetJoin<X,Y>
join(SetAttribute<? super X,Y> set)
           
<Y> SetJoin<X,Y>
join(SetAttribute<? super X,Y> set, JoinType jt)
           
<Y> Join<X,Y>
join(SingularAttribute<? super X,Y> singularAttribute)
           
<Y> Join<X,Y>
join(SingularAttribute<? super X,Y> attribute, JoinType jt)
           
<X,Y> Join<X,Y>
join(String attributeName)
           
<X,Y> Join<X,Y>
join(String attributeName, JoinType jt)
           
<X,Y> CollectionJoin<X,Y>
joinCollection(String attributeName)
           
<X,Y> CollectionJoin<X,Y>
joinCollection(String attributeName, JoinType jt)
           
<X,Y> ListJoin<X,Y>
joinList(String attributeName)
           
<X,Y> ListJoin<X,Y>
joinList(String attributeName, JoinType jt)
           
<X,K,V> MapJoin<X,K,V>
joinMap(String attributeName)
           
<X,K,V> MapJoin<X,K,V>
joinMap(String attributeName, JoinType jt)
           
<X,Y> SetJoin<X,Y>
joinSet(String attributeName)
           
<X,Y> SetJoin<X,Y>
joinSet(String attributeName, JoinType jt)
           
protected  Attribute<X,?> locateAttributeInternal(String name)
          Get the attribute by name from the underlying model.
protected  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 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 Attribute<?,?> getAttribute()
Description copied from interface: PathImplementor
Retrieve reference to the attribute this path represents.

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

getParent

public From<?,Z> getParent()

locateAttributeInternal

protected Attribute<X,?> locateAttributeInternal(String name)
Description copied from class: AbstractPathImpl
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 ManagedType<? super X> locateManagedType()

isCorrelated

public boolean isCorrelated()
Specified by:
isCorrelated in interface From<Z,X>

getCorrelationParent

public FromImplementor<Z,X> getCorrelationParent()
Specified by:
getCorrelationParent in interface 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<Join<X,?>> getJoins()
Specified by:
getJoins in interface From<Z,X>

join

public <Y> Join<X,Y> join(SingularAttribute<? super X,Y> singularAttribute)
Specified by:
join in interface From<Z,X>

join

public <Y> Join<X,Y> join(SingularAttribute<? super X,Y> attribute,
                          JoinType jt)
Specified by:
join in interface From<Z,X>

join

public <Y> CollectionJoin<X,Y> join(CollectionAttribute<? super X,Y> collection)
Specified by:
join in interface From<Z,X>

join

public <Y> CollectionJoin<X,Y> join(CollectionAttribute<? super X,Y> collection,
                                    JoinType jt)
Specified by:
join in interface From<Z,X>

join

public <Y> SetJoin<X,Y> join(SetAttribute<? super X,Y> set)
Specified by:
join in interface From<Z,X>

join

public <Y> SetJoin<X,Y> join(SetAttribute<? super X,Y> set,
                             JoinType jt)
Specified by:
join in interface From<Z,X>

join

public <Y> ListJoin<X,Y> join(ListAttribute<? super X,Y> list)
Specified by:
join in interface From<Z,X>

join

public <Y> ListJoin<X,Y> join(ListAttribute<? super X,Y> list,
                              JoinType jt)
Specified by:
join in interface From<Z,X>

join

public <K,V> MapJoin<X,K,V> join(MapAttribute<? super X,K,V> map)
Specified by:
join in interface From<Z,X>

join

public <K,V> MapJoin<X,K,V> join(MapAttribute<? super X,K,V> map,
                                 JoinType jt)
Specified by:
join in interface From<Z,X>

join

public <X,Y> Join<X,Y> join(String attributeName)
Specified by:
join in interface From<Z,X>

join

public <X,Y> Join<X,Y> join(String attributeName,
                            JoinType jt)
Specified by:
join in interface From<Z,X>

joinCollection

public <X,Y> CollectionJoin<X,Y> joinCollection(String attributeName)
Specified by:
joinCollection in interface From<Z,X>

joinCollection

public <X,Y> CollectionJoin<X,Y> joinCollection(String attributeName,
                                                JoinType jt)
Specified by:
joinCollection in interface From<Z,X>

joinSet

public <X,Y> SetJoin<X,Y> joinSet(String attributeName)
Specified by:
joinSet in interface From<Z,X>

joinSet

public <X,Y> SetJoin<X,Y> joinSet(String attributeName,
                                  JoinType jt)
Specified by:
joinSet in interface From<Z,X>

joinList

public <X,Y> ListJoin<X,Y> joinList(String attributeName)
Specified by:
joinList in interface From<Z,X>

joinList

public <X,Y> ListJoin<X,Y> joinList(String attributeName,
                                    JoinType jt)
Specified by:
joinList in interface From<Z,X>

joinMap

public <X,K,V> MapJoin<X,K,V> joinMap(String attributeName)
Specified by:
joinMap in interface From<Z,X>

joinMap

public <X,K,V> MapJoin<X,K,V> joinMap(String attributeName,
                                      JoinType jt)
Specified by:
joinMap in interface From<Z,X>

canBeFetchSource

protected boolean canBeFetchSource()

getFetches

public Set<Fetch<X,?>> getFetches()
Specified by:
getFetches in interface FetchParent<Z,X>

fetch

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

fetch

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

fetch

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

fetch

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

fetch

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

fetch

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


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