Class JakartaTypeConverterUtils


  • public class JakartaTypeConverterUtils
    extends Object
    Convenience methods for handling Jakarta Persistence AttributeConverters.
    • Constructor Detail

      • JakartaTypeConverterUtils

        public JakartaTypeConverterUtils()
    • Method Detail

      • getAttributeTypeForAttributeConverter

        public static Class getAttributeTypeForAttributeConverter​(Class<? extends jakarta.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 class
        attrTypeFallback - 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 jakarta.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 class
        attrType - Type for the attribute
        dbTypeFallback - The fallback to return if the datastore type is not found
        Returns:
        The datastore type for this converter
      • createAttributeConverterInstance

        public static jakarta.persistence.AttributeConverter createAttributeConverterInstance​(org.datanucleus.NucleusContext nucCtx,
                                                                                              Class<? extends jakarta.persistence.AttributeConverter> attrConverterCls)