Class MetamodelHelper
- java.lang.Object
-
- org.apache.openjpa.persistence.jest.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 inAttribute.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)
-
-
-
Field Detail
-
DASH
public static final char DASH
- See Also:
- Constant Field Values
-
UNDERSCORE
public static final char UNDERSCORE
- See Also:
- Constant Field Values
-
-
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
-
-
-