Class RegularFieldFieldResolver

java.lang.Object
io.github.blyznytsiaorg.bibernate.entity.type.RegularFieldFieldResolver
All Implemented Interfaces:
TypeFieldResolver

public class RegularFieldFieldResolver extends Object implements TypeFieldResolver
Implementation of TypeFieldResolver for resolving custom injection values for regular fields of an entity class. The regular fields are the simple fields that are not Entity or Collections

This resolver is responsible for determining if a given field of an entity class is a regular field and preparing the value to be injected into the field.

  • Constructor Details

    • RegularFieldFieldResolver

      public RegularFieldFieldResolver()
  • Method Details

    • isAppropriate

      public boolean isAppropriate(Field field)

      Determines if the resolver is appropriate for the given field. This implementation returns true if the field is a regular field (i.e., not an association).

      Specified by:
      isAppropriate in interface TypeFieldResolver
      Parameters:
      field - the field to be evaluated for custom injection
      Returns:
      true if the field is a regular field, false otherwise
    • prepareValueForFieldInjection

      public Object prepareValueForFieldInjection(Field field, ResultSet resultSet, Object entityClass, EntityPersistent entityPersistent)

      Prepares the value to be injected into the specified regular field of the entity. This implementation extracts the value from the result set using the column name corresponding to the field.

      Specified by:
      prepareValueForFieldInjection in interface TypeFieldResolver
      Parameters:
      field - the regular field to receive the injected value
      resultSet - the result set containing the data from which the value will be extracted
      entityClass - the entity object to which the field belongs
      entityPersistent - the persistent metadata associated with the entity
      Returns:
      the value to be injected into the regular field