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.
|
Constructor and Description |
---|
AnnotationBasedPersistentProperty(Property property,
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.
|
Class<?> |
getAssociationTargetType()
Return the type the property refers to in case it's an association.
|
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, getPersistentEntityTypes, getProperty, getRawType, getSetter, getType, getTypeInformation, getWither, hashCode, isArray, isCollectionLike, isEntity, isImmutable, isMap
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getRequiredAnnotation, getRequiredAssociation, getRequiredField, getRequiredGetter, getRequiredSetter, getRequiredWither, hasActualTypeAnnotation
public boolean isIdProperty
public boolean isVersionProperty
public AnnotationBasedPersistentProperty(Property property, PersistentEntity<?,P> owner, SimpleTypeHolder simpleTypeHolder)
AnnotationBasedPersistentProperty
.property
- must not be null.owner
- must not be null.@Nullable 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>>
PersistentProperty.isTransient()
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>>
@Nullable 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)
@Nullable 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>>
@Nullable public Class<?> getAssociationTargetType()
PersistentProperty
public String toString()
toString
in class AbstractPersistentProperty<P extends PersistentProperty<P>>
Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.