Class EntityMetadata

java.lang.Object
io.fluxzero.sdk.modeling.EntityMetadata

public final class EntityMetadata extends Object
Cached structural metadata for an entity, persisted root, or type containing model handlers.

Instances are owned by ReflectionUtils.TypeMetadata; callers must use of(Class) instead of constructing or caching this metadata independently.

  • Method Details

    • of

      public static EntityMetadata of(Class<?> type)
      Returns the centrally cached entity metadata for a Java type.
    • validate

      public static EntityMetadata validate(Class<?> type)
      Returns and validates the centrally cached metadata, including all statically typed parent relations reachable from this type.

      Same-type recursive relations and relations using untyped IDs are checked for concrete ID cycles when their relationship deltas are committed.

    • acceptsPayload

      public static boolean acceptsPayload(EntityMetadata.HandlerMethod handler, Class<?> payloadType)
      Returns whether a model handler can structurally consume the supplied payload type.
    • compatibleTypes

      public static boolean compatibleTypes(Class<?> left, Class<?> right)
      Returns whether two declared model types can describe the same runtime value.
    • type

      public Class<?> type()
    • isModel

      public boolean isModel()
    • revision

      public int revision()
      Returns this type's serializer revision.
    • rootConfiguration

      public Optional<EntityMetadata.RootConfiguration> rootConfiguration()
      Returns aggregate-neutral persistence settings for an explicitly annotated root.
    • entityId

      public Optional<EntityMetadata.Property> entityId()
    • repositoryId

      public String repositoryId(Object functionalId)
      Returns the exact repository identity for a functional identifier of this type.

      When the entity property is an Id subtype, a String input is interpreted as that ID's functional value, so the ID's own repository prefix is applied before the outer EntityId affixes.

    • repositoryIdOf

      public String repositoryIdOf(Object value)
      Returns the exact repository identity read from this type's EntityId property.
    • parentScopedEntityId

      public boolean parentScopedEntityId()
      Returns whether this model's persisted identity is scoped by a parent relationship.
    • functionalIdOf

      public Object functionalIdOf(Object value)
      Returns the functional value held by this type's EntityId property.
    • identifies

      public boolean identifies(String repositoryId, Object value)
      Returns whether a non-null model value carries the supplied exact repository identity.
    • repositoryId

      public String repositoryId(Object functionalId, Object parentId, Class<?> parentType)
      Resolves a parent-scoped primary identity from a functional child ID and explicit parent.
    • repositoryId

      public String repositoryId(Object functionalId, Object source)
      Returns the repository identity for a known functional ID, reading parent scope from the supplied source only when this model explicitly opted into parent-scoped identity.
    • hasAliases

      public boolean hasAliases()
      Whether this model declares at least one independently persisted alias.
    • aliases

      public List<String> aliases(Object value)
      Returns the complete aliases declared by the supplied model value, or null when its type does not participate in independent-model alias persistence.
    • parentReferences

      public List<EntityMetadata.ParentReference> parentReferences()
    • parentRelationships

      public List<EntityMetadata.ParentRelationship> parentRelationships(String modelId, Object value)
      Resolves and deduplicates the outgoing parent relationships of one model value.

      This is the only runtime extraction of Parent values. Graph views, batch overlays, cascade selection and repository commits consume this immutable result instead of independently reading structural metadata.

    • participatesInGraphComposition

      public boolean participatesInGraphComposition()
      Whether this model is placed in an automatically composed graph through at least one explicit parent path.

      Graph participation is independent from Model.persistence(): a Model can supply an internal current document for composition without exposing a direct document through its own collection.

    • modelDocumentCollection

      public Optional<String> modelDocumentCollection()
      Returns the application-resolved collection that owns this Model's current document, if it has one.
    • modelDocumentReadCollection

      public String modelDocumentReadCollection()
      Returns the collection queried for a current document, including the historical empty-document fallback for a non-event-sourced Model that does not materialize one itself.
    • graphProjectionConfiguration

      public Optional<io.fluxzero.common.api.modeling.ModelGraphProjectionConfiguration> graphProjectionConfiguration()
      Returns this root's application-resolved materialized graph definition, if enabled.
    • graphProjectionConfiguration

      public Optional<io.fluxzero.common.api.modeling.ModelGraphProjectionConfiguration> graphProjectionConfiguration(Collection<Class<?>> knownModelTypes)
      Returns this root's durable graph definition including every known model schema that can be placed below it.
    • graphProjectionRoots

      public static List<EntityMetadata.GraphProjectionRoot> graphProjectionRoots(Class<?> modelType)
      Returns every materialized projection root reachable through this model's typed parent relationships.
    • handlerMethods

      public List<EntityMetadata.HandlerMethod> handlerMethods()
    • applyMethods

      public List<EntityMetadata.HandlerMethod> applyMethods()