public interface PersistentEntity extends PersistentElement
AnnotationMetadata
provided is consistent both at runtime and compilation time.PersistentProperty
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAliasName() |
java.util.Collection<? extends Association> |
getAssociations()
A list of the associations for this entity.
|
PersistentProperty[] |
getCompositeIdentity()
The composite id.
|
default java.lang.String |
getDecapitalizedName() |
java.util.Collection<Embedded> |
getEmbedded()
A list of embedded associations for this entity.
|
PersistentProperty |
getIdentity()
Returns the identity of the instance.
|
java.lang.String |
getName()
The entity name including any package prefix.
|
NamingStrategy |
getNamingStrategy()
Obtain the naming strategy for the entity.
|
PersistentEntity |
getParentEntity()
Returns the parent entity of this entity.
|
default java.util.Optional<java.lang.String> |
getPath(java.lang.String camelCasePath)
Computes a dot separated property path for the given camel case path.
|
java.util.Collection<? extends PersistentProperty> |
getPersistentProperties()
A list of properties to be persisted.
|
java.util.Collection<java.lang.String> |
getPersistentPropertyNames()
A list of property names that a persistent.
|
PersistentProperty |
getPropertyByName(java.lang.String name)
Obtains a PersistentProperty instance by name.
|
default java.util.Optional<PersistentProperty> |
getPropertyByPath(java.lang.String path)
Return a property for a dot separated property path such as
foo.bar.prop
. |
default PersistentEntity |
getRootEntity()
Obtains the root entity of an inheritance hierarchy.
|
default java.lang.String |
getSimpleName() |
PersistentProperty |
getVersion()
Returns the version property.
|
default boolean |
isEmbeddable() |
boolean |
isOwningEntity(PersistentEntity owner)
Returns whether the specified entity asserts ownership over this
entity.
|
default boolean |
isRoot()
Whether this entity is a root entity.
|
default boolean |
isVersioned()
Is the entity versioned for optimistic locking.
|
static <T> RuntimePersistentEntity<T> |
of(io.micronaut.core.beans.BeanIntrospection<T> introspection)
Creates a new persistent entity representation of the given type.
|
static <T> RuntimePersistentEntity<T> |
of(java.lang.Class<T> type)
Creates a new persistent entity representation of the given type.
|
getPersistedName
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
@NonNull java.lang.String getName()
getName
in interface io.micronaut.core.naming.Named
@NonNull java.lang.String getAliasName()
@Nullable PersistentProperty[] getCompositeIdentity()
@Nullable PersistentProperty getIdentity()
@Nullable PersistentProperty getVersion()
default boolean isVersioned()
@NonNull java.util.Collection<? extends PersistentProperty> getPersistentProperties()
@NonNull java.util.Collection<? extends Association> getAssociations()
getPersistentProperties()
@NonNull java.util.Collection<Embedded> getEmbedded()
getPersistentProperties()
@Nullable PersistentProperty getPropertyByName(java.lang.String name)
name
- The name of the property@NonNull java.util.Collection<java.lang.String> getPersistentPropertyNames()
default boolean isEmbeddable()
@NonNull default java.lang.String getSimpleName()
@NonNull default java.lang.String getDecapitalizedName()
boolean isOwningEntity(PersistentEntity owner)
owner
- The owning entity@Nullable PersistentEntity getParentEntity()
default java.util.Optional<java.lang.String> getPath(java.lang.String camelCasePath)
camelCasePath
- The camel case path@NonNull default PersistentEntity getRootEntity()
default boolean isRoot()
default java.util.Optional<PersistentProperty> getPropertyByPath(java.lang.String path)
foo.bar.prop
.path
- The path@NonNull NamingStrategy getNamingStrategy()
@NonNull static <T> RuntimePersistentEntity<T> of(@NonNull java.lang.Class<T> type)
Introspected
. This method will create a new instance on demand and does not cache.T
- The generic typetype
- The type@NonNull static <T> RuntimePersistentEntity<T> of(@NonNull io.micronaut.core.beans.BeanIntrospection<T> introspection)
Introspected
. This method will create a new instance on demand and does not cache.T
- The generic typeintrospection
- The introspection