Class PropertyValueConverter
- java.lang.Object
-
- de.terrestris.shoguncore.converter.PropertyValueConverter
-
public class PropertyValueConverter extends Object implements javax.persistence.AttributeConverter<Object,String>
This converter can be used for the values of the type Map. The values of the map will be converted to strings to persist them in a string column in the database. A string value coming from the database will be converted to the best matching Java type.
Currently
String,Long,DoubleandBooleanvalues are supported.- Author:
- Nils Bühner
-
-
Constructor Summary
Constructors Constructor Description PropertyValueConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringconvertToDatabaseColumn(Object attribute)Converts an arbitrary object to it's string representation, that will be stored in the database.ObjectconvertToEntityAttribute(String dbData)Converts a string value from the database to the best matching java primitive type.
-