Class ToOneRelationFieldResolver

java.lang.Object
io.github.blyznytsiaorg.bibernate.ddl.field.ToOneRelationFieldResolver
All Implemented Interfaces:
FieldResolver

public class ToOneRelationFieldResolver extends Object implements FieldResolver
Resolves fields representing one-to-one or many-to-one relationships in entity columns.
Since:
1.0
Author:
Blyzhnytsia Team
See Also:
  • Constructor Details

    • ToOneRelationFieldResolver

      public ToOneRelationFieldResolver()
  • Method Details

    • hasFieldToResolve

      public boolean hasFieldToResolve(EntityColumnDetails entityColumnDetails)
      Determines if there is a field to resolve based on the provided entity column details.
      Specified by:
      hasFieldToResolve in interface FieldResolver
      Parameters:
      entityColumnDetails - The entity column details to check.
      Returns:
      True if there is a field to resolve, false otherwise.
    • handleField

      public void handleField(DDLFieldMetadataHolder metadataHolder, Map<Integer,List<String>> ddlMetadata)
      Handles the resolution of the given entity column details by generating database type information and adding it to the list of column name and database type.
      Specified by:
      handleField in interface FieldResolver
      Parameters:
      metadataHolder - The holder containing metadata related to the field.
      ddlMetadata - The map storing DDL metadata.
    • processForeignKeyConstraint

      private void processForeignKeyConstraint(String foreignKey, Set<String> foreignNameConstraints, String tableName, EntityMetadata metadataOfRelation, String joinColumnName, Map<Integer,List<String>> ddlMetadata)
    • checkIfRelationExists

      private void checkIfRelationExists(Class<?> entityClass, Class<?> fieldType, EntityMetadata metadataOfRelation)