org.apache.openjpa.persistence.jest
Class MetamodelHelper

java.lang.Object
  extended by org.apache.openjpa.persistence.jest.MetamodelHelper

public class MetamodelHelper
extends Object

Author:
Pinaki Poddar

Nested Class Summary
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
static char DASH
           
static char UNDERSCORE
           
 
Constructor Summary
MetamodelHelper()
           
 
Method Summary
static MetamodelHelper.AttributeCategory getAttributeCategory(Attribute<?,?> attr)
          Gets a ordinal value of enumerated persistent attribute category.
static List<Attribute<?,?>> getAttributesInOrder(Class<?> cls, Metamodel model)
           
static List<Attribute<?,?>> getAttributesInOrder(ClassMetaData meta, Metamodel model)
           
static List<Attribute<?,?>> getAttributesInOrder(ManagedType<?> type)
          Gets the attributes of the given type in defined order.
static String getAttributeTypeName(Attribute<?,?> attr)
          Gets name of the attribute type.
static String getTagByAttributeType(Attribute<?,?> attr)
           
static boolean isEnum(Attribute<?,?> a)
           
static boolean isId(Attribute<?,?> a)
           
static boolean isLob(Attribute<?,?> a)
           
static boolean isVersion(Attribute<?,?> a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DASH

public static final char DASH
See Also:
Constant Field Values

UNDERSCORE

public static final char UNDERSCORE
See Also:
Constant Field Values
Constructor Detail

MetamodelHelper

public MetamodelHelper()
Method Detail

getAttributesInOrder

public static List<Attribute<?,?>> getAttributesInOrder(Class<?> cls,
                                                        Metamodel model)

getAttributesInOrder

public static List<Attribute<?,?>> getAttributesInOrder(ClassMetaData meta,
                                                        Metamodel model)

getAttributesInOrder

public static List<Attribute<?,?>> getAttributesInOrder(ManagedType<?> type)
Gets the attributes of the given type in defined order.

Parameters:
type -
Returns:

isId

public static boolean isId(Attribute<?,?> a)

isVersion

public static boolean isVersion(Attribute<?,?> a)

isEnum

public static boolean isEnum(Attribute<?,?> a)

isLob

public static boolean isLob(Attribute<?,?> a)

getAttributeCategory

public static MetamodelHelper.AttributeCategory getAttributeCategory(Attribute<?,?> attr)
Gets a ordinal value of enumerated persistent attribute category.

Parameters:
attr -
Returns:

getTagByAttributeType

public static String getTagByAttributeType(Attribute<?,?> attr)

getAttributeTypeName

public static String getAttributeTypeName(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 -
Returns:


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.