Class EntityMetadata
java.lang.Object
io.github.blyznytsiaorg.bibernate.entity.metadata.EntityMetadata
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 Summary
Modifier and TypeFieldDescriptionprivate final boolean
private static final String
private final List
<EntityColumnDetails> private final boolean
private final List
<IndexMetadata> private static final String
private final String
private final Class
<?> -
Constructor Summary
ConstructorDescriptionEntityMetadata
(String tableName, boolean immutable, boolean dynamicUpdate, Class<?> type) Constructs an EntityMetadata object with the specified table name, immutability, dynamic update and entity type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntityColumn
(EntityColumnDetails entityColumn) Adds an entity column to the entity metadata.void
addIndexMetadata
(List<IndexMetadata> indexMetadata) Adds a list of index metadata to the entity metadata.Retrieves the entity columns with cascade remove relations.private boolean
Checks if the cascade type for the specified entity column includes REMOVE or ALL.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.
-
Field Details
-
NOT_SPECIFIED_ENTITY_ID_FOR_ENTITY
- See Also:
-
EMPTY
- See Also:
-
tableName
-
immutable
private final boolean immutable -
dynamicUpdate
private final boolean dynamicUpdate -
type
-
indexMetadatas
-
entityColumns
-
-
Constructor Details
-
EntityMetadata
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
Adds a list of index metadata to the entity metadata.- Parameters:
indexMetadata
- The list of index metadata to add.
-
addEntityColumn
Adds an entity column to the entity metadata.- Parameters:
entityColumn
- The entity column to add.
-
getCascadeRemoveRelations
Retrieves the entity columns with cascade remove relations.- Returns:
- A list of entity columns with cascade remove relations.
-
isRemoveCascadeType
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.
-