Class UlidConverter
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.jpa.UlidConverter
-
public class UlidConverter extends Object implements javax.persistence.AttributeConverter<String,String>
Serves to pass through the string ULID representation of the field in the Java entity class into a varchar field in the database. This is the most readable option and serves as the easiest option during data troubleshooting. However, the Base32 string representation does use more memory to store the value in the database, which can be important when considering database index size. There is a byte array converting version of this class 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
Fields Modifier and Type Field Description static UlidConverter
INSTANCE
-
Constructor Summary
Constructors Constructor Description UlidConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
convertToDatabaseColumn(String attribute)
String
convertToEntityAttribute(String dbData)
static UlidConverter
getInstance()
-
-
-
Field Detail
-
INSTANCE
public static final UlidConverter INSTANCE
-
-
Method Detail
-
getInstance
public static UlidConverter getInstance()
-
-