org.hibernate.ejb.criteria.path
Class AbstractPathImpl<X>
java.lang.Object
org.hibernate.ejb.criteria.AbstractNode
org.hibernate.ejb.criteria.expression.AbstractTupleElement<X>
org.hibernate.ejb.criteria.expression.SelectionImpl<T>
org.hibernate.ejb.criteria.expression.ExpressionImpl<X>
org.hibernate.ejb.criteria.path.AbstractPathImpl<X>
- All Implemented Interfaces:
- Serializable, javax.persistence.criteria.Expression<X>, javax.persistence.criteria.Path<X>, javax.persistence.criteria.Selection<X>, TupleElement<X>, ExpressionImplementor<X>, ParameterContainer, PathImplementor<X>, PathSource<X>, Renderable, SelectionImplementor<X>, TupleElementImplementor<X>
- Direct Known Subclasses:
- AbstractFromImpl, MapKeyHelpers.MapKeyPath, MapKeyHelpers.MapKeySource, PluralAttributePath, SingularAttributePath
public abstract class AbstractPathImpl<X>
- extends ExpressionImpl<X>
- implements javax.persistence.criteria.Path<X>, PathImplementor<X>, Serializable
Convenience base class for various Path
implementors.
- Author:
- Steve Ebersole
- See Also:
- Serialized Form
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.persistence.criteria.Path |
getModel |
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 |
AbstractPathImpl
public AbstractPathImpl(CriteriaBuilderImpl criteriaBuilder,
Class<X> javaType,
PathSource pathSource)
- Constructs a basic path instance.
- Parameters:
criteriaBuilder
- The criteria builderjavaType
- The java type of this pathpathSource
- The source (or origin) from which this path originates
getPathSource
public PathSource getPathSource()
getParentPath
public PathSource<?> getParentPath()
-
- Specified by:
getParentPath
in interface javax.persistence.criteria.Path<X>
type
public javax.persistence.criteria.Expression<Class<? extends X>> type()
-
- Specified by:
type
in interface javax.persistence.criteria.Path<X>
getPathIdentifier
public String getPathIdentifier()
- Get the string representation of this path as a navigation from one of the
queries identification variables
- Specified by:
getPathIdentifier
in interface PathSource<X>
- Returns:
- The path's identifier.
canBeDereferenced
protected abstract boolean canBeDereferenced()
illegalDereference
protected final RuntimeException illegalDereference()
unknownAttribute
protected final RuntimeException unknownAttribute(String attributeName)
resolveCachedAttributePath
protected final javax.persistence.criteria.Path resolveCachedAttributePath(String attributeName)
registerAttributePath
protected final void registerAttributePath(String attributeName,
javax.persistence.criteria.Path path)
get
public <Y> javax.persistence.criteria.Path<Y> get(javax.persistence.metamodel.SingularAttribute<? super X,Y> attribute)
-
- Specified by:
get
in interface javax.persistence.criteria.Path<X>
get
public <E,C extends Collection<E>> javax.persistence.criteria.Expression<C> get(javax.persistence.metamodel.PluralAttribute<X,C,E> attribute)
-
- Specified by:
get
in interface javax.persistence.criteria.Path<X>
get
public <K,V,M extends Map<K,V>> javax.persistence.criteria.Expression<M> get(javax.persistence.metamodel.MapAttribute<X,K,V> attribute)
-
- Specified by:
get
in interface javax.persistence.criteria.Path<X>
get
public <Y> javax.persistence.criteria.Path<Y> get(String attributeName)
-
- Specified by:
get
in interface javax.persistence.criteria.Path<X>
locateAttribute
protected final javax.persistence.metamodel.Attribute locateAttribute(String attributeName)
- Get the attribute by name from the underlying model. This allows subclasses to
define exactly how the attribute is derived.
- Parameters:
attributeName
- The name of the attribute to locate
- Returns:
- The attribute; should never return null.
- Throws:
IllegalArgumentException
- If no such attribute exists
locateAttributeInternal
protected abstract javax.persistence.metamodel.Attribute locateAttributeInternal(String attributeName)
- Get the attribute by name from the underlying model. This allows subclasses to
define exactly how the attribute is derived. Called from
locateAttribute(java.lang.String)
which also applies nullness checking for proper error reporting.
- Parameters:
attributeName
- The name of the attribute to locate
- Returns:
- The attribute; may be null.
- Throws:
IllegalArgumentException
- If no such attribute exists
registerParameters
public void registerParameters(ParameterRegistry registry)
- Register any parameters contained within this query component with the given registry.
- Specified by:
registerParameters
in interface ParameterContainer
- Parameters:
registry
- The parameter registry with which to register.
prepareAlias
public void prepareAlias(CriteriaQueryCompiler.RenderingContext renderingContext)
- Specified by:
prepareAlias
in interface PathSource<X>
render
public String render(CriteriaQueryCompiler.RenderingContext renderingContext)
-
- Specified by:
render
in interface Renderable
renderProjection
public String renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext)
-
- Specified by:
renderProjection
in interface Renderable
Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.