Class ColorAttributeConverter

java.lang.Object
org.fastnate.generator.test.primitive.ColorAttributeConverter
All Implemented Interfaces:
jakarta.persistence.AttributeConverter<Color,Integer>

public class ColorAttributeConverter extends Object implements jakarta.persistence.AttributeConverter<Color,Integer>
Converts a color to an int and vice versa.
Author:
Tobias Liefke
  • Constructor Details

    • ColorAttributeConverter

      public ColorAttributeConverter()
  • Method Details

    • convertToDatabaseColumn

      public Integer convertToDatabaseColumn(Color color)
      Specified by:
      convertToDatabaseColumn in interface jakarta.persistence.AttributeConverter<Color,Integer>
    • convertToEntityAttribute

      public Color convertToEntityAttribute(Integer rgba)
      Specified by:
      convertToEntityAttribute in interface jakarta.persistence.AttributeConverter<Color,Integer>