Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata

public Class MetadataHelper

extends Object
Class Inheritance
Static Imports
org.eclipse.persistence.config.PersistenceUnitProperties.CANONICAL_MODEL_SUB_PACKAGE, .PersistenceUnitProperties.CANONICAL_MODEL_SUB_PACKAGE_DEFAULT, .PersistenceUnitProperties.CANONICAL_MODEL_PREFIX, .PersistenceUnitProperties.CANONICAL_MODEL_PREFIX_DEFAULT, .PersistenceUnitProperties.CANONICAL_MODEL_SUFFIX, .PersistenceUnitProperties.CANONICAL_MODEL_SUFFIX_DEFAULT

INTERNAL: Common helper methods for the metadata processing.
Author
Guy Pelletier
Since
TopLink EJB 3.0 Reference Implementation

Field Summary

Modifier and TypeField and Description
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected static String
getCanonicalName(String name, Map<String, Object> properties)

INTERNAL: Return the canonical name.

public static Class<?>
getClassForName(String classname, ClassLoader loader)

INTERNAL: Load a class from a given class name.

pack-priv static Object
getClassInstance(Class<?> cls)

INTERNAL: Create a new instance of the class given.

pack-priv static Object
getClassInstance(String className, ClassLoader loader)

INTERNAL: Create a new instance of the class name.

public static String
getName(String name, String defaultName, String context, MetadataLogger logger, Object location)

INTERNAL: Helper method to return a field name from a candidate field name and a default field name.

public static String
getQualifiedCanonicalName(String qualifiedName, AbstractSession session)

INTERNAL: Return the qualified canonical name of the given qualified class name.

public static String
getQualifiedCanonicalName(String qualifiedName, Map<String, Object> properties)

INTERNAL: Return the canonical name applying any default package.

public static Integer
getValue(Integer value, Integer defaultValue)

INTERNAL: Helper method to return a string value if specified, otherwise returns the default value.

public static String
getValue(String value, String defaultValue)

INTERNAL: Helper method to return a string value if specified, otherwise returns the default value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

JPA_ORM_FILEback to summary
public static final String JPA_ORM_FILE

Constructor Detail

MetadataHelperback to summary
private MetadataHelper()

Method Detail

getCanonicalNameback to summary
protected static String getCanonicalName(String name, Map<String, Object> properties)

INTERNAL: Return the canonical name. This will apply the prefix and suffix qualifiers given to the canonical name. If the given prefix is null, the the default "" is applied. If the given suffix is null, then the default "_" will be applied.

getClassForNameback to summary
public static Class<?> getClassForName(String classname, ClassLoader loader)

INTERNAL: Load a class from a given class name. (XMLEntityMappings calls this one)

getClassInstanceback to summary
pack-priv static Object getClassInstance(Class<?> cls)

INTERNAL: Create a new instance of the class given.

getClassInstanceback to summary
pack-priv static Object getClassInstance(String className, ClassLoader loader)

INTERNAL: Create a new instance of the class name.

getNameback to summary
public static String getName(String name, String defaultName, String context, MetadataLogger logger, Object location)

INTERNAL: Helper method to return a field name from a candidate field name and a default field name. Requires the context from where this method is called to output the correct logging message when defaulting the field name. In some cases, both the name and defaultName could be "" or null, therefore, don't log a message and return name.

getQualifiedCanonicalNameback to summary
public static String getQualifiedCanonicalName(String qualifiedName, AbstractSession session)

INTERNAL: Return the qualified canonical name of the given qualified class name. This method will check the session for a corresponding class that was processed during deploy. If one is not found, will build the canonical name applying any default package and the default suffix qualifier "_".

getQualifiedCanonicalNameback to summary
public static String getQualifiedCanonicalName(String qualifiedName, Map<String, Object> properties)

INTERNAL: Return the canonical name applying any default package. This will apply the prefix and suffix qualifiers given to the canonical name. If the prefix is null, the default "" is applied. If the suffix is null, then the default "_" will be applied.

getValueback to summary
public static Integer getValue(Integer value, Integer defaultValue)

INTERNAL: Helper method to return a string value if specified, otherwise returns the default value.

getValueback to summary
public static String getValue(String value, String defaultValue)

INTERNAL: Helper method to return a string value if specified, otherwise returns the default value.