public abstract class AbstractPathImpl<X> extends ExpressionImpl<X> implements Path<X>, PathImplementor<X>, Serializable
Path implementations.ParameterContainer.Helper| Constructor and Description |
|---|
AbstractPathImpl(CriteriaBuilderImpl criteriaBuilder,
Class<X> javaType,
PathSource pathSource)
Constructs a basic path instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
canBeDereferenced() |
<K,V,M extends Map<K,V>> |
get(MapAttribute<X,K,V> attribute)
Create a path corresponding to the referenced
map-valued attribute.
|
<E,C extends Collection<E>> |
get(PluralAttribute<X,C,E> attribute)
Create a path corresponding to the referenced
collection-valued attribute.
|
<Y> Path<Y> |
get(SingularAttribute<? super X,Y> attribute)
Create a path corresponding to the referenced
single-valued attribute.
|
<Y> Path<Y> |
get(String attributeName)
Create a path corresponding to the referenced attribute.
|
PathSource<?> |
getParentPath()
Return the parent "node" in the path or null if no parent.
|
String |
getPathIdentifier()
Get the string representation of this path as a navigation from one of the
queries identification variables
|
PathSource |
getPathSource() |
protected PathSource |
getPathSourceForSubPaths() |
protected RuntimeException |
illegalDereference() |
protected Attribute |
locateAttribute(String attributeName)
Get the attribute by name from the underlying model.
|
protected abstract Attribute |
locateAttributeInternal(String attributeName)
Get the attribute by name from the underlying model.
|
void |
prepareAlias(RenderingContext renderingContext) |
protected void |
registerAttributePath(String attributeName,
Path path) |
void |
registerParameters(ParameterRegistry registry)
Register any parameters contained within this query component with the given registry.
|
String |
render(RenderingContext renderingContext) |
String |
renderProjection(RenderingContext renderingContext) |
protected Path |
resolveCachedAttributePath(String attributeName) |
Expression<Class<? extends X>> |
type()
Create an expression corresponding to the type of the path.
|
protected RuntimeException |
unknownAttribute(String attributeName) |
as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, in, in, in, in, isNotNull, isNullalias, getCompoundSelectionItems, getValueHandlers, isCompoundSelectionforceConversion, getAlias, getJavaType, getValueHandler, resetJavaType, setAliascriteriaBuilderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttribute, treatAsasBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asStringgetValueHandlersgetValueHandleras, in, in, in, in, isNotNull, isNullalias, getCompoundSelectionItems, isCompoundSelectiongetAlias, getJavaTypepublic AbstractPathImpl(CriteriaBuilderImpl criteriaBuilder, Class<X> javaType, PathSource pathSource)
criteriaBuilder - The criteria builderjavaType - The java type of this pathpathSource - The source (or origin) from which this path originatespublic PathSource getPathSource()
public PathSource<?> getParentPath()
PathgetParentPath in interface Path<X>public Expression<Class<? extends X>> type()
Pathpublic String getPathIdentifier()
PathSourcegetPathIdentifier in interface PathSource<X>protected abstract boolean canBeDereferenced()
protected final RuntimeException illegalDereference()
protected final RuntimeException unknownAttribute(String attributeName)
public <Y> Path<Y> get(SingularAttribute<? super X,Y> attribute)
Pathprotected PathSource getPathSourceForSubPaths()
public <E,C extends Collection<E>> Expression<C> get(PluralAttribute<X,C,E> attribute)
Pathpublic <K,V,M extends Map<K,V>> Expression<M> get(MapAttribute<X,K,V> attribute)
Pathpublic <Y> Path<Y> get(String attributeName)
Path Note: Applications using the string-based API may need to
specify the type resulting from the get operation in order
to avoid the use of Path variables.
For example:
CriteriaQuery<Person> q = cb.createQuery(Person.class);
Root<Person> p = q.from(Person.class);
q.select(p)
.where(cb.isMember("joe",
p.<Set<String>>get("nicknames")));
rather than:
CriteriaQuery<Person> q = cb.createQuery(Person.class);
Root<Person> p = q.from(Person.class);
Path<Set<String>> nicknames = p.get("nicknames");
q.select(p)
.where(cb.isMember("joe", nicknames));
protected final Attribute locateAttribute(String attributeName)
attributeName - The name of the attribute to locateIllegalArgumentException - If no such attribute existsprotected abstract Attribute locateAttributeInternal(String attributeName)
locateAttribute(java.lang.String)
which also applies nullness checking for proper error reporting.attributeName - The name of the attribute to locateIllegalArgumentException - If no such attribute existspublic void registerParameters(ParameterRegistry registry)
ParameterContainerregisterParameters in interface ParameterContainerregistry - The parameter registry with which to register.public void prepareAlias(RenderingContext renderingContext)
prepareAlias in interface PathSource<X>public String render(RenderingContext renderingContext)
render in interface Renderablepublic String renderProjection(RenderingContext renderingContext)
renderProjection in interface RenderableCopyright © 2018 JBoss by Red Hat. All rights reserved.