java.lang.Object
io.github.blyznytsiaorg.bibernate.entity.metadata.EntityMetadata

public class EntityMetadata extends Object
Represents metadata for an entity, including table name, immutability, dynamic update, entity type, index metadata and entity columns.
Since:
1.0
Author:
Blyzhnytsia Team
See Also:
  • Field Details

  • Constructor Details

    • EntityMetadata

      public EntityMetadata(String tableName, boolean immutable, boolean dynamicUpdate, Class<?> type)
      Constructs an EntityMetadata object with the specified table name, immutability, dynamic update and entity type.
      Parameters:
      tableName - The name of the table associated with the entity.
      immutable - A boolean indicating whether the entity is immutable.
      dynamicUpdate - A boolean indicating whether dynamic update is enabled for the entity.
      type - The class representing the entity type.
  • Method Details

    • addIndexMetadata

      public void addIndexMetadata(List<IndexMetadata> indexMetadata)
      Adds a list of index metadata to the entity metadata.
      Parameters:
      indexMetadata - The list of index metadata to add.
    • addEntityColumn

      public void addEntityColumn(EntityColumnDetails entityColumn)
      Adds an entity column to the entity metadata.
      Parameters:
      entityColumn - The entity column to add.
    • getCascadeRemoveRelations

      public List<EntityColumnDetails> getCascadeRemoveRelations()
      Retrieves the entity columns with cascade remove relations.
      Returns:
      A list of entity columns with cascade remove relations.
    • isRemoveCascadeType

      private boolean isRemoveCascadeType(EntityColumnDetails column)
      Checks if the cascade type for the specified entity column includes REMOVE or ALL.
      Parameters:
      column - The entity column details to check.
      Returns:
      true if the cascade type includes REMOVE or ALL, otherwise false.
    • joinInfos

      public Set<JoinInfo> joinInfos(Class<?> entityClass, List<EntityColumnDetails> currentEntityColumns, Map<Class<?>,EntityMetadata> bibernateEntityMetadata, Set<Class<?>> trackVisitedClasses)
      Retrieves the join information for the specified entity class and its associated entity columns.
      Parameters:
      entityClass - The entity class to retrieve join information for.
      currentEntityColumns - The list of entity columns to analyze.
      bibernateEntityMetadata - The metadata map containing entity metadata.
      trackVisitedClasses - The set of visited classes to avoid cyclic dependencies.
      Returns:
      The set of join information for the specified entity class.