public class JpaAttributeMetadata extends java.lang.Object implements AttributeMetadata
AttributeMetadata for JPA.| Constructor and Description |
|---|
JpaAttributeMetadata(javax.persistence.metamodel.EntityType<?> entityType,
javax.persistence.metamodel.Attribute attribute) |
| Modifier and Type | Method and Description |
|---|---|
<A extends java.lang.annotation.Annotation> |
annotation(java.lang.Class<A> annoType)
Get the given annotation.
|
java.util.Collection<?> |
asCollection(java.lang.Object target)
Get the path of this attribute as a
Collection. |
java.util.Map |
asMap(java.lang.Object target)
Get the path of this attribute as a
Map. |
java.util.Set<?> |
asSet(java.lang.Object target)
Get the path of this attribute as a
Set. |
java.lang.Class<?> |
elementType()
The element type of this attribute, if this attribute is a "plural"-like attribute (a Collection, Map, etc...).
|
java.lang.Object |
get(java.lang.Object target)
Get the path of this attribute.
|
boolean |
hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annoType)
Does this attribute have the given annotation on it?
|
boolean |
isCollectionLike()
Can this attribute look like a
Collection? |
boolean |
isMapLike()
Can this attribute look like a
Map? |
boolean |
isNullable()
Whether this attribute can be nulled or not.
|
boolean |
isSetLike()
Can this attribute look like a
Set? |
java.lang.Class<?> |
keyType()
The type of this map's key, if it's map-like.
|
java.lang.String |
name()
Name of the attribute.
|
AttributeMetadata |
set(java.lang.Object value,
java.lang.Object target)
Set the path of this attribute.
|
java.lang.String |
toString() |
java.lang.Class<?> |
type()
The type of this attribute.
|
public JpaAttributeMetadata(javax.persistence.metamodel.EntityType<?> entityType,
javax.persistence.metamodel.Attribute attribute)
public java.lang.String name()
AttributeMetadataname in interface AttributeMetadatapublic java.lang.Class<?> type()
AttributeMetadatatype in interface AttributeMetadatapublic java.lang.Class<?> keyType()
AttributeMetadatakeyType in interface AttributeMetadatapublic java.lang.Class<?> elementType()
AttributeMetadataelementType in interface AttributeMetadatapublic boolean isNullable()
AttributeMetadataisNullable in interface AttributeMetadatapublic boolean isCollectionLike()
AttributeMetadataCollection?isCollectionLike in interface AttributeMetadatapublic java.util.Collection<?> asCollection(java.lang.Object target)
AttributeMetadataCollection.asCollection in interface AttributeMetadatatarget - The entity to inspect for this attribute.Collectionpublic boolean isSetLike()
AttributeMetadataSet?isSetLike in interface AttributeMetadatapublic java.util.Set<?> asSet(java.lang.Object target)
AttributeMetadataSet.asSet in interface AttributeMetadatatarget - The entity to inspect for this attribute.Setpublic boolean isMapLike()
AttributeMetadataMap?isMapLike in interface AttributeMetadatapublic java.util.Map asMap(java.lang.Object target)
AttributeMetadataMap.asMap in interface AttributeMetadatatarget - The entity to inspect for this attribute.Mappublic boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annoType)
AttributeMetadatahasAnnotation in interface AttributeMetadataannoType - The type of annotation to search for.public <A extends java.lang.annotation.Annotation> A annotation(java.lang.Class<A> annoType)
AttributeMetadataannotation in interface AttributeMetadataannoType - The type of annotation to get.public java.lang.Object get(java.lang.Object target)
AttributeMetadataget in interface AttributeMetadatatarget - The entity to inspect for this attribute.public AttributeMetadata set(java.lang.Object value, java.lang.Object target)
AttributeMetadataset in interface AttributeMetadatavalue - Value to set on this attribute.target - The entity to set this attribute's value on.public java.lang.String toString()
toString in class java.lang.Object