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, Expression<X>, Path<X>, 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 Path<X>, PathImplementor<X>, Serializable
Convenience base class for various Path
implementors.
- 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 |
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 Path<X>
type
public Expression<Class<? extends X>> type()
-
- Specified by:
type
in interface 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 Path resolveCachedAttributePath(String attributeName)
registerAttributePath
protected final void registerAttributePath(String attributeName,
Path path)
get
public <Y> Path<Y> get(SingularAttribute<? super X,Y> attribute)
-
- Specified by:
get
in interface Path<X>
get
public <E,C extends Collection<E>> Expression<C> get(PluralAttribute<X,C,E> attribute)
-
- Specified by:
get
in interface Path<X>
get
public <K,V,M extends Map<K,V>> Expression<M> get(MapAttribute<X,K,V> attribute)
-
- Specified by:
get
in interface Path<X>
get
public <Y> Path<Y> get(String attributeName)
-
- Specified by:
get
in interface Path<X>
locateAttribute
protected final 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 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-2012 Red Hat, Inc. All Rights Reserved.