Class MetamodelHelper


  • public class MetamodelHelper
    extends java.lang.Object
    Author:
    Pinaki Poddar
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MetamodelHelper.AttributeCategory
      Attribute Category makes a finer distinction over PersistentAttributeType declared in Attribute.PersistentAttributeType such as id, version, lob or enum.
      static class  MetamodelHelper.AttributeComparator
      Compares attribute by their category and within the same category by name.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static char DASH  
      static char UNDERSCORE  
    • Constructor Summary

      Constructors 
      Constructor Description
      MetamodelHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MetamodelHelper.AttributeCategory getAttributeCategory​(jakarta.persistence.metamodel.Attribute<?,​?> attr)
      Gets a ordinal value of enumerated persistent attribute category.
      static java.util.List<jakarta.persistence.metamodel.Attribute<?,​?>> getAttributesInOrder​(jakarta.persistence.metamodel.ManagedType<?> type)
      Gets the attributes of the given type in defined order.
      static java.util.List<jakarta.persistence.metamodel.Attribute<?,​?>> getAttributesInOrder​(java.lang.Class<?> cls, jakarta.persistence.metamodel.Metamodel model)  
      static java.util.List<jakarta.persistence.metamodel.Attribute<?,​?>> getAttributesInOrder​(ClassMetaData meta, jakarta.persistence.metamodel.Metamodel model)  
      static java.lang.String getAttributeTypeName​(jakarta.persistence.metamodel.Attribute<?,​?> attr)
      Gets name of the attribute type.
      static java.lang.String getTagByAttributeType​(jakarta.persistence.metamodel.Attribute<?,​?> attr)  
      static boolean isEnum​(jakarta.persistence.metamodel.Attribute<?,​?> a)  
      static boolean isId​(jakarta.persistence.metamodel.Attribute<?,​?> a)  
      static boolean isLob​(jakarta.persistence.metamodel.Attribute<?,​?> a)  
      static boolean isVersion​(jakarta.persistence.metamodel.Attribute<?,​?> a)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MetamodelHelper

        public MetamodelHelper()
    • Method Detail

      • getAttributesInOrder

        public static java.util.List<jakarta.persistence.metamodel.Attribute<?,​?>> getAttributesInOrder​(java.lang.Class<?> cls,
                                                                                                              jakarta.persistence.metamodel.Metamodel model)
      • getAttributesInOrder

        public static java.util.List<jakarta.persistence.metamodel.Attribute<?,​?>> getAttributesInOrder​(ClassMetaData meta,
                                                                                                              jakarta.persistence.metamodel.Metamodel model)
      • getAttributesInOrder

        public static java.util.List<jakarta.persistence.metamodel.Attribute<?,​?>> getAttributesInOrder​(jakarta.persistence.metamodel.ManagedType<?> type)
        Gets the attributes of the given type in defined order.
        Parameters:
        type -
      • isId

        public static boolean isId​(jakarta.persistence.metamodel.Attribute<?,​?> a)
      • isVersion

        public static boolean isVersion​(jakarta.persistence.metamodel.Attribute<?,​?> a)
      • isEnum

        public static boolean isEnum​(jakarta.persistence.metamodel.Attribute<?,​?> a)
      • isLob

        public static boolean isLob​(jakarta.persistence.metamodel.Attribute<?,​?> a)
      • getAttributeCategory

        public static MetamodelHelper.AttributeCategory getAttributeCategory​(jakarta.persistence.metamodel.Attribute<?,​?> attr)
        Gets a ordinal value of enumerated persistent attribute category.
        Parameters:
        attr -
      • getTagByAttributeType

        public static java.lang.String getTagByAttributeType​(jakarta.persistence.metamodel.Attribute<?,​?> attr)
      • getAttributeTypeName

        public static java.lang.String getAttributeTypeName​(jakarta.persistence.metamodel.Attribute<?,​?> attr)
        Gets name of the attribute type. For collection and map type attribute, the name is appended with generic type argument names.
        Parameters:
        attr -