Package africa.absa.inception.security
Class TenantStatusConverter
- java.lang.Object
-
- africa.absa.inception.security.TenantStatusConverter
-
- All Implemented Interfaces:
javax.persistence.AttributeConverter<TenantStatus,Integer>
public class TenantStatusConverter extends Object implements javax.persistence.AttributeConverter<TenantStatus,Integer>
The TenantStatusConverter class implements the custom JPA converter for the TenantStatus enumeration.- Author:
- Marcus Portmann
-
-
Constructor Summary
Constructors Constructor Description TenantStatusConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegerconvertToDatabaseColumn(TenantStatus attribute)Converts the value stored in the entity attribute into the data representation to be stored in the database.TenantStatusconvertToEntityAttribute(Integer dbData)Converts the data stored in the database column into the value to be stored in the entity attribute.
-
-
-
Method Detail
-
convertToDatabaseColumn
public Integer convertToDatabaseColumn(TenantStatus attribute)
Converts the value stored in the entity attribute into the data representation to be stored in the database.- Specified by:
convertToDatabaseColumnin interfacejavax.persistence.AttributeConverter<TenantStatus,Integer>- Parameters:
attribute- the entity attribute value to be converted- Returns:
- the converted data to be stored in the database column
-
convertToEntityAttribute
public TenantStatus 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:
convertToEntityAttributein interfacejavax.persistence.AttributeConverter<TenantStatus,Integer>- Parameters:
dbData- the data from the database column to be converted- Returns:
- the converted value to be stored in the entity attribute
-
-