public abstract class AnnotationBasedPersistentProperty<P extends PersistentProperty<P>> extends AbstractPersistentProperty<P>
PersistentProperty
that takes annotations at a property into account.Type | Property and Description |
---|---|
boolean |
isId
Gets the value of the property idProperty.
|
boolean |
isVersion
Gets the value of the property versionProperty.
|
association, field, information, name, owner, propertyDescriptor, rawType
Constructor and Description |
---|
AnnotationBasedPersistentProperty(Field field,
PropertyDescriptor propertyDescriptor,
PersistentEntity<?,P> owner,
SimpleTypeHolder simpleTypeHolder)
Creates a new
AnnotationBasedPersistentProperty . |
Modifier and Type | Method and Description |
---|---|
<A extends Annotation> |
findAnnotation(Class<A> annotationType)
Returns the annotation found for the current
AnnotationBasedPersistentProperty . |
<A extends Annotation> |
findPropertyOrOwnerAnnotation(Class<A> annotationType)
Looks up the annotation of the given type on the property and the owning type if no annotation can be found on it.
|
String |
getSpelExpression()
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotationType)
Returns whether the property carries the an annotation of the given type.
|
boolean |
isAssociation()
Considers the property an
Association if it is annotated with Reference . |
boolean |
isIdProperty()
Gets the value of the property idProperty.
|
boolean |
isTransient()
|
boolean |
isVersionProperty()
Gets the value of the property versionProperty.
|
boolean |
isWritable()
Returns whether the current property is writable, i.e. if the value held for it shall be written to the data store.
|
String |
toString() |
boolean |
usePropertyAccess()
Returns whether property access shall be used for reading the property value.
|
createAssociation, equals, getActualType, getAssociation, getComponentType, getField, getGetter, getMapValueType, getName, getOwner, getPersistentEntityType, getRawType, getSetter, getType, getTypeInformation, hashCode, isArray, isCollectionLike, isEntity, isMap
public boolean isIdProperty
public boolean isVersionProperty
public AnnotationBasedPersistentProperty(Field field, PropertyDescriptor propertyDescriptor, PersistentEntity<?,P> owner, SimpleTypeHolder simpleTypeHolder)
AnnotationBasedPersistentProperty
.field
- must not be null.propertyDescriptor
- can be null.owner
- must not be null.public String getSpelExpression()
Value
annotation at the property and returns the String
value of
it.getSpelExpression
in interface PersistentProperty<P extends PersistentProperty<P>>
getSpelExpression
in class AbstractPersistentProperty<P extends PersistentProperty<P>>
AbstractPersistentProperty.getSpelExpression()
public boolean isTransient()
isTransient
in interface PersistentProperty<P extends PersistentProperty<P>>
isTransient
in class AbstractPersistentProperty<P extends PersistentProperty<P>>
BasicPersistentProperty
public boolean isIdProperty()
public boolean isVersionProperty()
public boolean isAssociation()
Association
if it is annotated with Reference
.isAssociation
in interface PersistentProperty<P extends PersistentProperty<P>>
isAssociation
in class AbstractPersistentProperty<P extends PersistentProperty<P>>
public boolean isWritable()
PersistentProperty
isWritable
in interface PersistentProperty<P extends PersistentProperty<P>>
isWritable
in class AbstractPersistentProperty<P extends PersistentProperty<P>>
public <A extends Annotation> A findAnnotation(Class<A> annotationType)
AnnotationBasedPersistentProperty
. Will prefer getters or
setters annotations over ones found at the backing field as the former can be used to reconfigure the metadata in
subclasses.annotationType
- must not be null.AnnotationUtils.findAnnotation(Method, Class)
public <A extends Annotation> A findPropertyOrOwnerAnnotation(Class<A> annotationType)
PersistentProperty
annotationType
- must not be null.public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
annotationType
- the annotation type to look up.public boolean usePropertyAccess()
PersistentProperty
usePropertyAccess
in interface PersistentProperty<P extends PersistentProperty<P>>
usePropertyAccess
in class AbstractPersistentProperty<P extends PersistentProperty<P>>
public String toString()
toString
in class AbstractPersistentProperty<P extends PersistentProperty<P>>
Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.