Package com.jk.core.jpa
Class JKCSVConvertor
java.lang.Object
com.jk.core.jpa.JKCSVConvertor
public class JKCSVConvertor
extends Object
implements jakarta.persistence.AttributeConverter<List<String>,String>
This class is can be used to convert entity attribute state into database
column representation and back again.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToDatabaseColumn
(List<String> attribute) Converts the value stored in the entity attribute into the data representation to be stored in the database.convertToEntityAttribute
(String dbData) Converts the data stored in the database column into the value to be stored in the entity attribute.
-
Constructor Details
-
JKCSVConvertor
public JKCSVConvertor()
-
-
Method Details
-
convertToDatabaseColumn
Converts the value stored in the entity attribute into the data representation to be stored in the database. -
convertToEntityAttribute
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 correctdbData
type for the corresponding column for use by the JDBC driver: i.e., persistence providers are not expected to do such type conversion.
-