Package org.datanucleus.api.jpa.metadata
Class JPATypeConverterUtils
- java.lang.Object
-
- org.datanucleus.api.jpa.metadata.JPATypeConverterUtils
-
public class JPATypeConverterUtils extends Object
Convenience methods for handling JPA AttributeConverters.
-
-
Constructor Summary
Constructors Constructor Description JPATypeConverterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.persistence.AttributeConverter
createAttributeConverterInstance(org.datanucleus.NucleusContext nucCtx, Class<? extends javax.persistence.AttributeConverter> attrConverterCls)
static Class
getAttributeTypeForAttributeConverter(Class<? extends javax.persistence.AttributeConverter> converterCls, Class attrTypeFallback)
Convenience method that takes the class of an AttributeConverter class, and returns the attribute type that it is for.static Class
getDatabaseTypeForAttributeConverter(Class<? extends javax.persistence.AttributeConverter> converterCls, Class attrType, Class dbTypeFallback)
Convenience method that takes the class of an AttributeConverter class, and returns the datastore type that it is for.
-
-
-
Method Detail
-
getAttributeTypeForAttributeConverter
public static Class getAttributeTypeForAttributeConverter(Class<? extends javax.persistence.AttributeConverter> converterCls, Class attrTypeFallback)
Convenience method that takes the class of an AttributeConverter class, and returns the attribute type that it is for.- Parameters:
converterCls
- The converter classattrTypeFallback
- The fallback to return if the attribute type is not found- Returns:
- The attribute type for this converter
-
getDatabaseTypeForAttributeConverter
public static Class getDatabaseTypeForAttributeConverter(Class<? extends javax.persistence.AttributeConverter> converterCls, Class attrType, Class dbTypeFallback)
Convenience method that takes the class of an AttributeConverter class, and returns the datastore type that it is for.- Parameters:
converterCls
- The converter classattrType
- Type for the attributedbTypeFallback
- The fallback to return if the datastore type is not found- Returns:
- The datastore type for this converter
-
createAttributeConverterInstance
public static javax.persistence.AttributeConverter createAttributeConverterInstance(org.datanucleus.NucleusContext nucCtx, Class<? extends javax.persistence.AttributeConverter> attrConverterCls)
-
-