Package io.micronaut.data.model
Interface PersistentProperty
- All Superinterfaces:
- io.micronaut.core.annotation.AnnotationMetadataProvider,- io.micronaut.core.annotation.AnnotationSource,- io.micronaut.core.naming.Named,- PersistentElement
- All Known Subinterfaces:
- Association,- Embedded
- All Known Implementing Classes:
- RuntimeAssociation,- RuntimePersistentProperty,- SourceAssociation,- SourcePersistentProperty
Models a persistent property. That is a property that is saved and retrieved from the database.
- Since:
- 1.0
- Author:
- graemerocher
- 
Field SummaryFields inherited from interface io.micronaut.core.annotation.AnnotationSourceEMPTY
- 
Method SummaryModifier and TypeMethodDescriptiondefault @NonNull StringThe name with the first letter in upper case as per Java bean conventions.default @Nullable AttributeConverter<Object,Object> default DataTypedefault JsonDataType@NonNull StringgetName()The name of the property.@NonNull PersistentEntitygetOwner()Obtains the owner of this persistent property.@NonNull StringThe type of the property.default booleanisAssignable(@NonNull Class<?> type) Is the property assignable to the given type.booleanisAssignable(@NonNull String type) Is the property assignable to the given type name.default booleandefault booleandefault booleanisEnum()default booleanWhether the property is generated.static booleanisNullableMetadata(@NonNull io.micronaut.core.annotation.AnnotationMetadata metadata) Return whether the metadata indicates the instance is nullable.default booleanWhether the property can be set to null.default booleanWhether the property is read-only, for example for generated values.default booleanWhether a property is required to be specified.Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProviderfindAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.core.annotation.AnnotationSourcegetAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclaredMethods inherited from interface io.micronaut.data.model.PersistentElementgetPersistedName
- 
Method Details- 
getNameThe name of the property.- Specified by:
- getNamein interface- io.micronaut.core.naming.Named
- Returns:
- The property name
 
- 
getCapitilizedNameThe name with the first letter in upper case as per Java bean conventions.- Returns:
- The capitilized name
 
- 
getTypeNameThe type of the property.- Returns:
- The property type
 
- 
getOwnerObtains the owner of this persistent property.- Returns:
- The owner
 
- 
isOptionaldefault boolean isOptional()Whether the property can be set to null.- Returns:
- True if it can
 
- 
isRequireddefault boolean isRequired()Whether a property is required to be specified. This returns false if the property is both not nullable and not generated.- Returns:
- True if the property is required
- See Also:
 
- 
isReadOnlydefault boolean isReadOnly()Whether the property is read-only, for example for generated values.- Returns:
- True if it is read-only
 
- 
isConstructorArgumentdefault boolean isConstructorArgument()- Returns:
- Is the property also a constructor argument.
 
- 
isGenerateddefault boolean isGenerated()Whether the property is generated.- Returns:
- True if is generated
 
- 
isAutoPopulateddefault boolean isAutoPopulated()- Returns:
- True if the property is autopopulated
 
- 
isAssignableIs the property assignable to the given type name.- Parameters:
- type- The type name
- Returns:
- True if it is
 
- 
isAssignableIs the property assignable to the given type.- Parameters:
- type- The type
- Returns:
- True it is
 
- 
getDataType- Returns:
- The data type
 
- 
getJsonDataType- Returns:
- The json data type for DataType.JSONfields. If none specified, default isJsonDataType.DEFAULT.
 
- 
isEnumdefault boolean isEnum()- Returns:
- Returns whether the property is an enum.
 
- 
getConverter- Returns:
- Returns possible property convertor.
 
- 
isNullableMetadatastatic boolean isNullableMetadata(@NonNull @NonNull io.micronaut.core.annotation.AnnotationMetadata metadata) Return whether the metadata indicates the instance is nullable.- Parameters:
- metadata- The metadata
- Returns:
- True if it is nullable
 
 
-