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
A runtime representation of
PersistentProperty
.- Since:
- 1.0.0
- Author:
- graemerocher
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.annotation.AnnotationMetadata
io.micronaut.core.type.Argument<Object>
@NonNull String
getName()
The name of the property.@NonNull RuntimePersistentEntity<T>
getOwner()
Obtains the owner of this persistent property.@NonNull String
The persisted name is the fully qualified name including potential schema definitions.@NonNull Class<?>
getType()
@NonNull String
The type of the property.boolean
isAssignable
(@NonNull Class<?> type) Is the property assignable to the given type.boolean
isAssignable
(@NonNull String type) Is the property assignable to the given type name.boolean
boolean
isEnum()
final boolean
Whether the property can be set to null.boolean
Whether the property is read-only, for example for generated values.toString()
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, getTargetAnnotationMetadata, 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 Details
-
EMPTY_PROPERTY_ARRAY
-
-
Method Details
-
getArgument
- Returns:
- The argument for this property.
-
isConstructorArgument
public boolean isConstructorArgument()- Specified by:
isConstructorArgument
in interfacePersistentProperty
- Returns:
- Is the property also a constructor argument.
-
isOptional
public final boolean isOptional()Description copied from interface:PersistentProperty
Whether the property can be set to null.- Specified by:
isOptional
in interfacePersistentProperty
- Returns:
- True if it can
-
isEnum
public boolean isEnum()- Specified by:
isEnum
in interfacePersistentProperty
- Returns:
- Returns whether the property is an enum.
-
getDataType
- Specified by:
getDataType
in interfacePersistentProperty
- Returns:
- The data type
-
getJsonDataType
- Specified by:
getJsonDataType
in interfacePersistentProperty
- Returns:
- The json data type for
DataType.JSON
fields. If none specified, default isJsonDataType.DEFAULT
.
-
isReadOnly
public boolean isReadOnly()Description copied from interface:PersistentProperty
Whether the property is read-only, for example for generated values.- Specified by:
isReadOnly
in interfacePersistentProperty
- Returns:
- True if it is read-only
-
getType
- Returns:
- The property type, unwrapped if primitive
-
getName
Description copied from interface:PersistentProperty
The name of the property.- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
- Specified by:
getName
in interfacePersistentProperty
- Returns:
- The property name
-
getTypeName
Description copied from interface:PersistentProperty
The type of the property.- Specified by:
getTypeName
in interfacePersistentProperty
- Returns:
- The property type
-
getOwner
Description copied from interface:PersistentProperty
Obtains the owner of this persistent property.- Specified by:
getOwner
in interfacePersistentProperty
- Returns:
- The owner
-
isAssignable
Description copied from interface:PersistentProperty
Is the property assignable to the given type name.- Specified by:
isAssignable
in interfacePersistentProperty
- Parameters:
type
- The type name- Returns:
- True if it is
-
isAssignable
Description copied from interface:PersistentProperty
Is the property assignable to the given type.- Specified by:
isAssignable
in interfacePersistentProperty
- Parameters:
type
- The type- Returns:
- True it is
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
getAnnotationMetadata
in interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getProperty
- Returns:
- The backing bean property
-
getConverter
- Specified by:
getConverter
in interfacePersistentProperty
- Returns:
- Returns possible property convertor.
-
getPersistedName
Description copied from interface:PersistentElement
The persisted name is the fully qualified name including potential schema definitions.- Specified by:
getPersistedName
in interfacePersistentElement
- Returns:
- The persisted name.
-
toString
-