Class ParaClassConverter

java.lang.Object
com.endurancetrio.data.competitor.model.converter.ParaClassConverter
All Implemented Interfaces:
jakarta.persistence.AttributeConverter<ParaClass,String>

public class ParaClassConverter extends Object implements jakarta.persistence.AttributeConverter<ParaClass,String>
The ParaClassConverter class is responsible for converting the ParaClass enum to its corresponding database column representation and vice versa.

This converter is used to persist the ParaClass enum as a string in the database. It converts the enum to its code when storing it in the database and converts the code back to the enum when retrieving it from the database.

  • Constructor Details

    • ParaClassConverter

      public ParaClassConverter()
  • Method Details

    • convertToDatabaseColumn

      public String convertToDatabaseColumn(ParaClass paraClass)
      Specified by:
      convertToDatabaseColumn in interface jakarta.persistence.AttributeConverter<ParaClass,String>
    • convertToEntityAttribute

      public ParaClass convertToEntityAttribute(String code)
      Specified by:
      convertToEntityAttribute in interface jakarta.persistence.AttributeConverter<ParaClass,String>