Class UlidConverter
java.lang.Object
com.broadleafcommerce.data.tracking.jpa.UlidConverter
- All Implemented Interfaces:
javax.persistence.AttributeConverter<String,
byte[]>
public class UlidConverter
extends Object
implements javax.persistence.AttributeConverter<String,byte[]>
Serves to convert the string ULID representation of the field in the Java entity class into the
byte array representation for storage in a binary field in the database. This can serve to save
some memory space in the database (especially for indexed fields) at the cost of readability and
easy data troubleshooting. There is a string passthrough version of this converter as well. Which
version is used is determined by which library is mounted on the classpath at runtime.
String fields in an entity class that should receive this persistence behaviour should be
annotated with @Convert(converter = UlidConverter.class)
.
- Author:
- Jeff Fischer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convertToDatabaseColumn
(String attribute) convertToEntityAttribute
(byte[] dbData) static UlidConverter
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
UlidConverter
public UlidConverter()
-
-
Method Details