Package io.micronaut.data.model.runtime
Class RuntimePersistentEntity<T>
java.lang.Object
io.micronaut.data.model.AbstractPersistentEntity
io.micronaut.data.model.runtime.RuntimePersistentEntity<T>
- Type Parameters:
- T- The type
- All Implemented Interfaces:
- io.micronaut.core.annotation.AnnotationMetadataProvider,- io.micronaut.core.annotation.AnnotationSource,- io.micronaut.core.naming.Named,- PersistentElement,- PersistentEntity
public class RuntimePersistentEntity<T>
extends AbstractPersistentEntity
implements PersistentEntity
Runtime implementation of 
PersistentEntity that uses pre-computed Introspected bean data and is completely stateless.- Since:
- 1.0
- Author:
- graemerocher
- 
Field SummaryFields inherited from interface io.micronaut.core.annotation.AnnotationSourceEMPTY
- 
Constructor SummaryConstructorsConstructorDescriptionRuntimePersistentEntity(@NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection) Default constructor.RuntimePersistentEntity(@NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection, Collection<io.micronaut.core.beans.BeanProperty<T, Object>> beanProperties) Default constructor.RuntimePersistentEntity(@NonNull Class<T> type) Default constructor.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanDoes cascade the persist to any of the associations.booleanDoes cascade the update to any of the associations.@NonNull String@NonNull Collection<RuntimeAssociation<T>>A list of the associations for this entity.@Nullable RuntimePersistentProperty<T>[]The composite id.protected RuntimePersistentEntity<T>Obtain an entity for the given type.@Nullable RuntimePersistentProperty<T>Returns the identity of the instance.@Nullable RuntimePersistentProperty<T>getIdentityByName(String name) Obtains an identity PersistentProperty instance by name.Returns all identity properties.io.micronaut.core.beans.BeanIntrospection<T>getName()The entity name including any package prefix.@Nullable PersistentEntityReturns the parent entity of this entity.@NonNull Collection<RuntimePersistentProperty<T>>A list of properties to be persisted.A list of property names that a persistent.@Nullable RuntimePersistentProperty<T>getPropertyByName(String name) Obtains a PersistentProperty instance by name.An alternative togetIdentityProperties()but that returnsRuntimePersistentProperty.@Nullable RuntimePersistentProperty<T>Returns the version property.booleanbooleanHas composite identity.booleanHas identity.booleanDoes the entity have post-load event listeners.booleanDoes the entity have post-persist event listeners.booleanDoes the entity have post-remove event listeners.booleanDoes the entity have post-update event listeners.booleanDoes the entity have pre-persist event listeners.booleanDoes the entity have pre-remove event listeners.booleanDoes the entity have pre-update event listeners.booleanisOwningEntity(PersistentEntity owner) Returns whether the specified entity asserts ownership over this entity.protected voidLog error message.protected @NonNull AttributeConverter<Object,Object> resolveConverter(@NonNull Class<?> converterClass) Resolves a converter instance.toString()Methods inherited from class io.micronaut.data.model.AbstractPersistentEntityequals, findNamingStrategy, getAnnotationMetadata, getNamingStrategy, getPersistedName, hashCodeMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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.PersistentElementgetPersistedNameMethods inherited from interface io.micronaut.data.model.PersistentEntityfindNamingStrategy, getDecapitalizedName, getEmbedded, getNamingStrategy, getPath, getPropertyByPath, getPropertyPath, getPropertyPath, getRootEntity, getSimpleName, isEmbeddable, isRoot, isVersioned
- 
Constructor Details- 
RuntimePersistentEntityDefault constructor.- Parameters:
- type- The type
 
- 
RuntimePersistentEntitypublic RuntimePersistentEntity(@NonNull @NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection) Default constructor.- Parameters:
- introspection- The introspection
 
- 
RuntimePersistentEntitypublic RuntimePersistentEntity(@NonNull @NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection, Collection<io.micronaut.core.beans.BeanProperty<T, Object>> beanProperties) Default constructor.- Parameters:
- introspection- The introspection
- beanProperties- The bean properties
 
 
- 
- 
Method Details- 
logDebugDescription copied from class:AbstractPersistentEntityLog error message.- Overrides:
- logDebugin class- AbstractPersistentEntity
- Parameters:
- message- The message
- e- The exception
 
- 
resolveConverter@NonNull protected @NonNull AttributeConverter<Object,Object> resolveConverter(@NonNull @NonNull Class<?> converterClass) Resolves a converter instance.- Parameters:
- converterClass- The converter class
- Returns:
- converter instance
 
- 
cascadesPersistpublic boolean cascadesPersist()Does cascade the persist to any of the associations.- Returns:
- True if it does
 
- 
cascadesUpdatepublic boolean cascadesUpdate()Does cascade the update to any of the associations.- Returns:
- True if it does
 
- 
hasPrePersistEventListenerspublic boolean hasPrePersistEventListeners()Does the entity have pre-persist event listeners.- Returns:
- True if it does
 
- 
hasPreRemoveEventListenerspublic boolean hasPreRemoveEventListeners()Does the entity have pre-remove event listeners.- Returns:
- True if it does
 
- 
hasPreUpdateEventListenerspublic boolean hasPreUpdateEventListeners()Does the entity have pre-update event listeners.- Returns:
- True if it does
 
- 
hasPostPersistEventListenerspublic boolean hasPostPersistEventListeners()Does the entity have post-persist event listeners.- Returns:
- True if it does
 
- 
hasPostUpdateEventListenerspublic boolean hasPostUpdateEventListeners()Does the entity have post-update event listeners.- Returns:
- True if it does
 
- 
hasPostRemoveEventListenerspublic boolean hasPostRemoveEventListeners()Does the entity have post-remove event listeners.- Returns:
- True if it does
 
- 
hasPostLoadEventListenerspublic boolean hasPostLoadEventListeners()Does the entity have post-load event listeners.- Returns:
- True if it does
 
- 
toString
- 
getAliasName- Specified by:
- getAliasNamein interface- PersistentEntity
- Overrides:
- getAliasNamein class- AbstractPersistentEntity
- Returns:
- A name to use when referring to this element via an alias.
 
- 
getIntrospection- Returns:
- The underlying introspection.
 
- 
getNameDescription copied from interface:PersistentEntityThe entity name including any package prefix.- Specified by:
- getNamein interface- io.micronaut.core.naming.Named
- Specified by:
- getNamein interface- PersistentEntity
- Returns:
- The entity name
 
- 
hasCompositeIdentitypublic boolean hasCompositeIdentity()Description copied from interface:PersistentEntityHas composite identity.- Specified by:
- hasCompositeIdentityin interface- PersistentEntity
- Returns:
- The true if composite identity present
 
- 
hasIdentitypublic boolean hasIdentity()Description copied from interface:PersistentEntityHas identity.- Specified by:
- hasIdentityin interface- PersistentEntity
- Returns:
- The true if identity present
 
- 
getCompositeIdentityDescription copied from interface:PersistentEntityThe composite id.- Specified by:
- getCompositeIdentityin interface- PersistentEntity
- Returns:
- The composite id or null if there isn't one
 
- 
getIdentityDescription copied from interface:PersistentEntityReturns the identity of the instance.- Specified by:
- getIdentityin interface- PersistentEntity
- Returns:
- The identity or null if there isn't one
 
- 
getIdentityPropertiesDescription copied from interface:PersistentEntityReturns all identity properties.- Specified by:
- getIdentityPropertiesin interface- PersistentEntity
- Returns:
- The identity properties
 
- 
getRuntimeIdentityPropertiesAn alternative togetIdentityProperties()but that returnsRuntimePersistentProperty.- Returns:
- The identity properties
 
- 
getVersionDescription copied from interface:PersistentEntityReturns the version property.- Specified by:
- getVersionin interface- PersistentEntity
- Returns:
- the property
 
- 
getPersistentPropertiesDescription copied from interface:PersistentEntityA list of properties to be persisted.- Specified by:
- getPersistentPropertiesin interface- PersistentEntity
- Returns:
- A list of PersistentProperty instances
 
- 
getAssociationsDescription copied from interface:PersistentEntityA list of the associations for this entity. This is typically a subset of the list returned byPersistentEntity.getPersistentProperties()- Specified by:
- getAssociationsin interface- PersistentEntity
- Returns:
- A list of associations
 
- 
getPropertyByNameDescription copied from interface:PersistentEntityObtains a PersistentProperty instance by name.- Specified by:
- getPropertyByNamein interface- PersistentEntity
- Parameters:
- name- The name of the property
- Returns:
- The PersistentProperty or null if it doesn't exist
 
- 
getIdentityByNameDescription copied from interface:PersistentEntityObtains an identity PersistentProperty instance by name.- Specified by:
- getIdentityByNamein interface- PersistentEntity
- Parameters:
- name- The name of the identity property
- Returns:
- The PersistentProperty or null if it doesn't exist
 
- 
getPersistentPropertyNamesDescription copied from interface:PersistentEntityA list of property names that a persistent.- Specified by:
- getPersistentPropertyNamesin interface- PersistentEntity
- Returns:
- A List of strings
 
- 
isOwningEntityDescription copied from interface:PersistentEntityReturns whether the specified entity asserts ownership over this entity.- Specified by:
- isOwningEntityin interface- PersistentEntity
- Parameters:
- owner- The owning entity
- Returns:
- True if it does own this entity
 
- 
getParentEntityDescription copied from interface:PersistentEntityReturns the parent entity of this entity.- Specified by:
- getParentEntityin interface- PersistentEntity
- Returns:
- The ParentEntity instance
 
- 
getEntityObtain an entity for the given type.- Parameters:
- type- The type
- Returns:
- The entity
- Throws:
- io.micronaut.core.beans.exceptions.IntrospectionException- if the entity doesn't exist
 
- 
getConstructorArguments- Returns:
- The constructor arguments.
 
- 
hasAutoPopulatedPropertiespublic boolean hasAutoPopulatedProperties()- Returns:
- Returns true if the entity has auto-populated properties.
 
 
-