com.mysema.query.types.path
Class BeanPath<T>

java.lang.Object
  extended by com.mysema.query.types.ExpressionBase<T>
      extended by com.mysema.query.types.expr.SimpleExpression<T>
          extended by com.mysema.query.types.path.BeanPath<T>
Type Parameters:
T - expression type
All Implemented Interfaces:
Expression<T>, Path<T>, Serializable
Direct Known Subclasses:
EntityPathBase, RelationalPathBase

public class BeanPath<T>
extends SimpleExpression<T>
implements Path<T>

BeanPath represents bean paths

Author:
tiwe
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.mysema.query.types.expr.SimpleExpression
primitive
 
Fields inherited from class com.mysema.query.types.ExpressionBase
type
 
Constructor Summary
BeanPath(Class<? extends T> type, Path<?> parent, String property)
           
BeanPath(Class<? extends T> type, PathMetadata<?> metadata)
           
BeanPath(Class<? extends T> type, PathMetadata<?> metadata, PathInits inits)
           
BeanPath(Class<? extends T> type, String variable)
           
 
Method Summary
<R,C> R
accept(Visitor<R,C> v, C context)
          Accept the visitor with the given context
protected
<P extends Path<?>>
P
add(P path)
          Template method for tracking child path creation
<U extends BeanPath<? extends T>>
U
as(Class<U> clazz)
          Cast the path to a subtype querytype
protected
<A> ArrayPath<A>
createArray(String property, Class<? super A[]> type)
          Create a new array path
protected  BooleanPath createBoolean(String property)
          Create a new Boolean path
protected
<A,Q extends SimpleExpression<? super A>>
CollectionPath<A,Q>
createCollection(String property, Class<? super A> type, Class<? super Q> queryType)
          Create a new Collection typed path
protected
<A extends Comparable>
ComparablePath<A>
createComparable(String property, Class<? super A> type)
          Create a new Comparable typed path
protected
<A extends Comparable>
DatePath<A>
createDate(String property, Class<? super A> type)
          Create a new Date path
protected
<A extends Comparable>
DateTimePath<A>
createDateTime(String property, Class<? super A> type)
          Create a new DateTime path
protected
<A extends Enum<A>>
EnumPath<A>
createEnum(String property, Class<A> type)
           
protected
<A,E extends SimpleExpression<? super A>>
ListPath<A,E>
createList(String property, Class<? super A> type, Class<? super E> queryType)
          Create a new List typed path
protected
<K,V,E extends SimpleExpression<? super V>>
MapPath<K,V,E>
createMap(String property, Class<? super K> key, Class<? super V> value, Class<? super E> queryType)
          Create a new Map typed path
protected
<A extends Number & Comparable<?>>
NumberPath<A>
createNumber(String property, Class<? super A> type)
          Create a new Number path
protected
<A,E extends SimpleExpression<? super A>>
SetPath<A,E>
createSet(String property, Class<? super A> type, Class<? super E> queryType)
          Create a new Set typed path
protected
<A> SimplePath<A>
createSimple(String property, Class<? super A> type)
          Create a new Simpe path
protected  StringPath createString(String property)
          Create a new String path
protected
<A extends Comparable>
TimePath<A>
createTime(String property, Class<? super A> type)
          Create a new Time path
 boolean equals(Object o)
           
protected  PathMetadata<?> forProperty(String property)
           
 AnnotatedElement getAnnotatedElement()
          Return the annotated element related to the given path For property paths the annotated element contains the annotations of the related field and/or getter method and for all others paths the annotated element is the expression type.
 PathMetadata<?> getMetadata()
          Get the metadata for this path
 Path<?> getRoot()
          Get the root for this path
 int hashCode()
           
<B extends T>
BooleanExpression
instanceOf(Class<B> type)
          Create an this instanceOf type expression
 
Methods inherited from class com.mysema.query.types.expr.SimpleExpression
as, as, count, countDistinct, eq, eq, in, in, in, isNotNull, isNull, ne, ne, notIn, notIn, notIn, when, when
 
Methods inherited from class com.mysema.query.types.ExpressionBase
getType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mysema.query.types.Expression
getType
 

Constructor Detail

BeanPath

public BeanPath(Class<? extends T> type,
                String variable)

BeanPath

public BeanPath(Class<? extends T> type,
                Path<?> parent,
                String property)

BeanPath

public BeanPath(Class<? extends T> type,
                PathMetadata<?> metadata)

BeanPath

public BeanPath(Class<? extends T> type,
                PathMetadata<?> metadata,
                @Nullable
                PathInits inits)
Method Detail

accept

public <R,C> R accept(Visitor<R,C> v,
                      C context)
Description copied from interface: Expression
Accept the visitor with the given context

Specified by:
accept in interface Expression<T>
Type Parameters:
R - return type
C - context type
Parameters:
v - visitor
context - context of visit
Returns:

as

public <U extends BeanPath<? extends T>> U as(Class<U> clazz)
Cast the path to a subtype querytype

Type Parameters:
T -
Parameters:
clazz -
Returns:

add

protected <P extends Path<?>> P add(P path)
Template method for tracking child path creation

Type Parameters:
P -
Parameters:
path -
Returns:

createArray

protected <A> ArrayPath<A> createArray(String property,
                                       Class<? super A[]> type)
Create a new array path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createBoolean

protected BooleanPath createBoolean(String property)
Create a new Boolean path

Parameters:
property -
Returns:

createCollection

protected <A,Q extends SimpleExpression<? super A>> CollectionPath<A,Q> createCollection(String property,
                                                                                         Class<? super A> type,
                                                                                         Class<? super Q> queryType)
Create a new Collection typed path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createComparable

protected <A extends Comparable> ComparablePath<A> createComparable(String property,
                                                                    Class<? super A> type)
Create a new Comparable typed path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createEnum

protected <A extends Enum<A>> EnumPath<A> createEnum(String property,
                                                     Class<A> type)
Type Parameters:
A -
Parameters:
property -
type -
Returns:

createDate

protected <A extends Comparable> DatePath<A> createDate(String property,
                                                        Class<? super A> type)
Create a new Date path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createDateTime

protected <A extends Comparable> DateTimePath<A> createDateTime(String property,
                                                                Class<? super A> type)
Create a new DateTime path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createList

protected <A,E extends SimpleExpression<? super A>> ListPath<A,E> createList(String property,
                                                                             Class<? super A> type,
                                                                             Class<? super E> queryType)
Create a new List typed path

Type Parameters:
A -
E -
Parameters:
property -
type -
queryType -
Returns:

createMap

protected <K,V,E extends SimpleExpression<? super V>> MapPath<K,V,E> createMap(String property,
                                                                               Class<? super K> key,
                                                                               Class<? super V> value,
                                                                               Class<? super E> queryType)
Create a new Map typed path

Type Parameters:
K -
V -
E -
Parameters:
property -
key -
value -
queryType -
Returns:

createNumber

protected <A extends Number & Comparable<?>> NumberPath<A> createNumber(String property,
                                                                       Class<? super A> type)
Create a new Number path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createSet

protected <A,E extends SimpleExpression<? super A>> SetPath<A,E> createSet(String property,
                                                                           Class<? super A> type,
                                                                           Class<? super E> queryType)
Create a new Set typed path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createSimple

protected <A> SimplePath<A> createSimple(String property,
                                         Class<? super A> type)
Create a new Simpe path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

createString

protected StringPath createString(String property)
Create a new String path

Parameters:
property -
Returns:

createTime

protected <A extends Comparable> TimePath<A> createTime(String property,
                                                        Class<? super A> type)
Create a new Time path

Type Parameters:
A -
Parameters:
property -
type -
Returns:

equals

public boolean equals(Object o)
Specified by:
equals in class SimpleExpression<T>

forProperty

protected PathMetadata<?> forProperty(String property)

getMetadata

public PathMetadata<?> getMetadata()
Description copied from interface: Path
Get the metadata for this path

Specified by:
getMetadata in interface Path<T>
Returns:

getRoot

public Path<?> getRoot()
Description copied from interface: Path
Get the root for this path

Specified by:
getRoot in interface Path<T>
Returns:

hashCode

public int hashCode()
Overrides:
hashCode in class SimpleExpression<T>

instanceOf

public <B extends T> BooleanExpression instanceOf(Class<B> type)
Create an this instanceOf type expression

Type Parameters:
B -
Parameters:
type -
Returns:

getAnnotatedElement

public AnnotatedElement getAnnotatedElement()
Description copied from interface: Path
Return the annotated element related to the given path For property paths the annotated element contains the annotations of the related field and/or getter method and for all others paths the annotated element is the expression type.

Specified by:
getAnnotatedElement in interface Path<T>
Returns:


Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.