Class SourcePersistentEntity

java.lang.Object
io.micronaut.data.model.AbstractPersistentEntity
io.micronaut.data.processor.model.SourcePersistentEntity
All Implemented Interfaces:
io.micronaut.core.annotation.AnnotatedElement, io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.naming.Described, io.micronaut.core.naming.Named, io.micronaut.data.model.PersistentElement, io.micronaut.data.model.PersistentEntity, io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate<io.micronaut.inject.ast.Element>, io.micronaut.inject.ast.Element, io.micronaut.inject.ast.TypedElement

@Internal public class SourcePersistentEntity extends io.micronaut.data.model.AbstractPersistentEntity implements io.micronaut.data.model.PersistentEntity, io.micronaut.inject.ast.TypedElement
An implementation of PersistentEntity that operates on the sources.
Since:
1.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata

    CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY

    Fields inherited from interface io.micronaut.inject.ast.Element

    EMPTY_ELEMENT_ARRAY

    Fields inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    SourcePersistentEntity(@NonNull io.micronaut.inject.ast.ClassElement classElement, @NonNull Function<io.micronaut.inject.ast.ClassElement,SourcePersistentEntity> entityResolver)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.inject.ast.ClassElement
     
     
     
     
    Obtains a PersistentProperty representing id or version property by name.
    @NonNull String
     
     
    @Nullable io.micronaut.data.model.PersistentEntity
     
     
    @NonNull List<String>
     
     
     
    @NonNull io.micronaut.inject.ast.ClassElement
     
     
    boolean
     
    boolean
     
    boolean
    isOwningEntity(io.micronaut.data.model.PersistentEntity owner)
     
    boolean
     
    boolean
     
     

    Methods inherited from class io.micronaut.data.model.AbstractPersistentEntity

    equals, findNamingStrategy, getAliasName, getAnnotationMetadata, getNamingStrategy, getPersistedName, hashCode, logDebug

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement

    isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata

    enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate

    booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

    getAnnotationMetadata

    Methods inherited from interface io.micronaut.inject.ast.Element

    annotate, annotate, annotate, annotate, annotate, getDescription, getDescription, getDocumentation, getModifiers, isAbstract, isFinal, isPackagePrivate, isPrivate, isStatic, isSynthetic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype, withAnnotationMetadata

    Methods inherited from interface io.micronaut.data.model.PersistentElement

    getPersistedName

    Methods inherited from interface io.micronaut.data.model.PersistentEntity

    findNamingStrategy, getAliasName, getAssociations, getDecapitalizedName, getEmbedded, getNamingStrategy, getPath, getPropertyByPath, getPropertyPath, getPropertyPath, getRootEntity, isEmbeddable, isRoot, isVersioned

    Methods inherited from interface io.micronaut.inject.ast.TypedElement

    getArrayDimensions, getGenericType, isArray, isPrimitive, isVoid
  • Constructor Details

    • SourcePersistentEntity

      public SourcePersistentEntity(@NonNull @NonNull io.micronaut.inject.ast.ClassElement classElement, @NonNull @NonNull Function<io.micronaut.inject.ast.ClassElement,SourcePersistentEntity> entityResolver)
      Default constructor.
      Parameters:
      classElement - The class element
      entityResolver - The entity resolver to resolve any additional entities such as associations
  • Method Details

    • getName

      @NonNull public @NonNull String getName()
      Specified by:
      getName in interface io.micronaut.inject.ast.Element
      Specified by:
      getName in interface io.micronaut.core.naming.Named
      Specified by:
      getName in interface io.micronaut.data.model.PersistentEntity
    • getSimpleName

      public String getSimpleName()
      Specified by:
      getSimpleName in interface io.micronaut.inject.ast.Element
      Specified by:
      getSimpleName in interface io.micronaut.data.model.PersistentEntity
    • isProtected

      public boolean isProtected()
      Specified by:
      isProtected in interface io.micronaut.inject.ast.Element
    • isPublic

      public boolean isPublic()
      Specified by:
      isPublic in interface io.micronaut.inject.ast.Element
    • getNativeType

      public Object getNativeType()
      Specified by:
      getNativeType in interface io.micronaut.inject.ast.Element
    • hasCompositeIdentity

      public boolean hasCompositeIdentity()
      Specified by:
      hasCompositeIdentity in interface io.micronaut.data.model.PersistentEntity
    • hasIdentity

      public boolean hasIdentity()
      Specified by:
      hasIdentity in interface io.micronaut.data.model.PersistentEntity
    • getCompositeIdentity

      @Nullable public @Nullable SourcePersistentProperty[] getCompositeIdentity()
      Specified by:
      getCompositeIdentity in interface io.micronaut.data.model.PersistentEntity
    • getIdentity

      @Nullable public @Nullable SourcePersistentProperty getIdentity()
      Specified by:
      getIdentity in interface io.micronaut.data.model.PersistentEntity
    • getVersion

      @Nullable public @Nullable SourcePersistentProperty getVersion()
      Specified by:
      getVersion in interface io.micronaut.data.model.PersistentEntity
    • getPersistentProperties

      @NonNull public @NonNull List<SourcePersistentProperty> getPersistentProperties()
      Specified by:
      getPersistentProperties in interface io.micronaut.data.model.PersistentEntity
    • getPropertyByName

      @Nullable public @Nullable SourcePersistentProperty getPropertyByName(String name)
      Specified by:
      getPropertyByName in interface io.micronaut.data.model.PersistentEntity
    • getIdentityByName

      @Nullable public @Nullable SourcePersistentProperty getIdentityByName(String name)
      Specified by:
      getIdentityByName in interface io.micronaut.data.model.PersistentEntity
    • getIdOrVersionPropertyByName

      public SourcePersistentProperty getIdOrVersionPropertyByName(String name)
      Obtains a PersistentProperty representing id or version property by name.
      Parameters:
      name - The name of the id or version property
      Returns:
      The PersistentProperty used as id or version or null if it doesn't exist
    • getPersistentPropertyNames

      @NonNull public @NonNull List<String> getPersistentPropertyNames()
      Specified by:
      getPersistentPropertyNames in interface io.micronaut.data.model.PersistentEntity
    • isOwningEntity

      public boolean isOwningEntity(io.micronaut.data.model.PersistentEntity owner)
      Specified by:
      isOwningEntity in interface io.micronaut.data.model.PersistentEntity
    • getParentEntity

      @Nullable public @Nullable io.micronaut.data.model.PersistentEntity getParentEntity()
      Specified by:
      getParentEntity in interface io.micronaut.data.model.PersistentEntity
    • getClassElement

      public io.micronaut.inject.ast.ClassElement getClassElement()
      Returns:
      The class element
    • getType

      @NonNull public @NonNull io.micronaut.inject.ast.ClassElement getType()
      Specified by:
      getType in interface io.micronaut.inject.ast.TypedElement
    • toString

      public String toString()
      Overrides:
      toString in class Object