Package io.micronaut.data.model.runtime
Class RuntimePersistentProperty<T>
- java.lang.Object
-
- io.micronaut.data.model.runtime.RuntimePersistentProperty<T>
-
- Type Parameters:
T- The owner type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider,io.micronaut.core.annotation.AnnotationSource,io.micronaut.core.naming.Named,PersistentElement,PersistentProperty
- Direct Known Subclasses:
RuntimeAssociation
public class RuntimePersistentProperty<T> extends java.lang.Object implements PersistentProperty
A runtime representation ofPersistentProperty.- Since:
- 1.0.0
- Author:
- graemerocher
-
-
Field Summary
Fields Modifier and Type Field Description static RuntimePersistentProperty<java.lang.Object>[]EMPTY_PROPERTY_ARRAY
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.micronaut.core.annotation.AnnotationMetadatagetAnnotationMetadata()io.micronaut.core.type.Argument<?>getArgument()AttributeConverter<java.lang.Object,java.lang.Object>getConverter()DataTypegetDataType()java.lang.StringgetName()The name of the property.RuntimePersistentEntity<T>getOwner()Obtains the owner of this persistent property.java.lang.StringgetPersistedName()The persisted name is the fully qualified name including potential schema definitions.io.micronaut.core.beans.BeanProperty<T,?>getProperty()java.lang.Class<?>getType()java.lang.StringgetTypeName()The type of the property.booleanisAssignable(java.lang.Class<?> type)Is the property assignable to the given type.booleanisAssignable(java.lang.String type)Is the property assignable to the given type name.booleanisConstructorArgument()booleanisEnum()booleanisOptional()Whether the property can be set to null.booleanisReadOnly()Whether the property is read-only, for example for generated values.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Methods inherited from interface io.micronaut.data.model.PersistentProperty
getCapitilizedName, isAutoPopulated, isGenerated, isRequired
-
-
-
-
Field Detail
-
EMPTY_PROPERTY_ARRAY
public static final RuntimePersistentProperty<java.lang.Object>[] EMPTY_PROPERTY_ARRAY
-
-
Method Detail
-
getArgument
public io.micronaut.core.type.Argument<?> getArgument()
- Returns:
- The argument for this property.
-
isConstructorArgument
public boolean isConstructorArgument()
- Specified by:
isConstructorArgumentin interfacePersistentProperty- Returns:
- Is the property also a constructor argument.
-
isOptional
public final boolean isOptional()
Description copied from interface:PersistentPropertyWhether the property can be set to null.- Specified by:
isOptionalin interfacePersistentProperty- Returns:
- True if it can
-
isEnum
public boolean isEnum()
- Specified by:
isEnumin interfacePersistentProperty- Returns:
- Returns whether the property is an enum.
-
getDataType
public DataType getDataType()
- Specified by:
getDataTypein interfacePersistentProperty- Returns:
- The data type
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:PersistentPropertyWhether the property is read-only, for example for generated values.- Specified by:
isReadOnlyin interfacePersistentProperty- Returns:
- True if it is read-only
-
getType
@NonNull public java.lang.Class<?> getType()
- Returns:
- The property type, unwrapped if primitive
-
getName
@NonNull public java.lang.String getName()
Description copied from interface:PersistentPropertyThe name of the property.- Specified by:
getNamein interfaceio.micronaut.core.naming.Named- Specified by:
getNamein interfacePersistentProperty- Returns:
- The property name
-
getTypeName
@NonNull public java.lang.String getTypeName()
Description copied from interface:PersistentPropertyThe type of the property.- Specified by:
getTypeNamein interfacePersistentProperty- Returns:
- The property type
-
getOwner
@NonNull public RuntimePersistentEntity<T> getOwner()
Description copied from interface:PersistentPropertyObtains the owner of this persistent property.- Specified by:
getOwnerin interfacePersistentProperty- Returns:
- The owner
-
isAssignable
public boolean isAssignable(@NonNull java.lang.String type)Description copied from interface:PersistentPropertyIs the property assignable to the given type name.- Specified by:
isAssignablein interfacePersistentProperty- Parameters:
type- The type name- Returns:
- True if it is
-
isAssignable
public boolean isAssignable(@NonNull java.lang.Class<?> type)Description copied from interface:PersistentPropertyIs the property assignable to the given type.- Specified by:
isAssignablein interfacePersistentProperty- Parameters:
type- The type- Returns:
- True it is
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getProperty
public io.micronaut.core.beans.BeanProperty<T,?> getProperty()
- Returns:
- The backing bean property
-
getConverter
public AttributeConverter<java.lang.Object,java.lang.Object> getConverter()
- Specified by:
getConverterin interfacePersistentProperty- Returns:
- Returns possible property convertor.
-
getPersistedName
@NonNull public java.lang.String getPersistedName()
Description copied from interface:PersistentElementThe persisted name is the fully qualified name including potential schema definitions.- Specified by:
getPersistedNamein interfacePersistentElement- Returns:
- The persisted name.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-