Class OracleRequiredFieldManagerModifier

java.lang.Object
org.broadleafcommerce.openadmin.server.service.persistence.module.OracleRequiredFieldManagerModifier
All Implemented Interfaces:
FieldManagerModifier, org.springframework.core.Ordered

@Component("blOracleRequiredFieldManagerModifier") public class OracleRequiredFieldManagerModifier extends Object implements FieldManagerModifier
Oracle-only field modifier that is used to ensure that non-nullable fields are not persisted with empty strings and instead use single-space strings.
Author:
Nick Crum ncrum
  • Field Details

    • TYPES_THAT_SUPPORT_SINGLE_SPACE_AS_DEFAULT

      protected static final List<String> TYPES_THAT_SUPPORT_SINGLE_SPACE_AS_DEFAULT
    • dialectHelper

      protected org.broadleafcommerce.common.util.DialectHelper dialectHelper
  • Constructor Details

    • OracleRequiredFieldManagerModifier

      public OracleRequiredFieldManagerModifier()
  • Method Details

    • canHandle

      public boolean canHandle(Field field, Object value, jakarta.persistence.EntityManager em)
      Description copied from interface: FieldManagerModifier
      Determines whether this modifier is able handle writing or reading this Field.
      Specified by:
      canHandle in interface FieldManagerModifier
      Parameters:
      field - the Field that is being handled
      value - the value that is being set or read
      em - the EntityManager
      Returns:
      whether this field can be handled
    • isRequiredField

      protected boolean isRequiredField(org.broadleafcommerce.common.presentation.AdminPresentation adminPresentation, jakarta.persistence.Column column)
    • isStringFieldType

      protected boolean isStringFieldType(Field field, org.broadleafcommerce.common.presentation.AdminPresentation adminPresentation)
    • getModifiedWriteValue

      public Object getModifiedWriteValue(Field field, Object value, Object newValue, jakarta.persistence.EntityManager em) throws IllegalAccessException
      Description copied from interface: FieldManagerModifier
      Returns a modified write value for the field.
      Specified by:
      getModifiedWriteValue in interface FieldManagerModifier
      Parameters:
      field - the field being modified
      value - the bean or object with the field
      newValue - the new value for the field
      em - the EntityManager
      Returns:
      the modified write value
      Throws:
      IllegalAccessException
      See Also:
    • getModifiedReadValue

      public Object getModifiedReadValue(Field field, Object value, jakarta.persistence.EntityManager em) throws IllegalAccessException
      Description copied from interface: FieldManagerModifier
      Returns a modified read value for the field.
      Specified by:
      getModifiedReadValue in interface FieldManagerModifier
      Parameters:
      field - the field being modified
      value - the value of the field
      em - the EntityManager
      Returns:
      Throws:
      IllegalAccessException
      See Also:
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered