Class PasswordResetStatusConverter

java.lang.Object
africa.absa.inception.security.PasswordResetStatusConverter
All Implemented Interfaces:
javax.persistence.AttributeConverter<PasswordResetStatus,Integer>

public class PasswordResetStatusConverter extends Object implements javax.persistence.AttributeConverter<PasswordResetStatus,Integer>
The PasswordResetStatusConverter class implements the custom JPA converter for the PasswordResetStatus enumeration.
Author:
Marcus Portmann
  • Constructor Details

    • PasswordResetStatusConverter

      public PasswordResetStatusConverter()
  • Method Details

    • convertToDatabaseColumn

      public Integer convertToDatabaseColumn(PasswordResetStatus attribute)
      Converts the value stored in the entity attribute into the data representation to be stored in the database.
      Specified by:
      convertToDatabaseColumn in interface javax.persistence.AttributeConverter<PasswordResetStatus,Integer>
      Parameters:
      attribute - the entity attribute value to be converted
      Returns:
      the converted data to be stored in the database column
    • convertToEntityAttribute

      public PasswordResetStatus convertToEntityAttribute(Integer dbData)
      Converts the data stored in the database column into the value to be stored in the entity attribute. Note that it is the responsibility of the converter writer to specify the correct dbData type for the corresponding column for use by the JDBC driver: i.e., persistence providers are not expected to do such type conversion.
      Specified by:
      convertToEntityAttribute in interface javax.persistence.AttributeConverter<PasswordResetStatus,Integer>
      Parameters:
      dbData - the data from the database column to be converted
      Returns:
      the converted value to be stored in the entity attribute