|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.mapping.loader.AbstractMappingLoader2
org.exolab.castor.mapping.loader.AbstractMappingLoader
org.exolab.castor.jdo.engine.JDOMappingLoader
public final class JDOMappingLoader
A JDO implementation of mapping helper. Creates JDO class descriptors from the mapping file.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.exolab.castor.mapping.loader.AbstractMappingLoader |
---|
AbstractMappingLoader.TypeInfoReference |
Field Summary |
---|
Fields inherited from class org.exolab.castor.mapping.loader.AbstractMappingLoader |
---|
EMPTY_ARGS, STRING_ARG, VALUE_OF |
Constructor Summary | |
---|---|
JDOMappingLoader(java.lang.ClassLoader loader)
Creates an instance of JDOMappingLoader , providing a
ClassLoader instance. |
Method Summary | |
---|---|
protected ClassDescriptor |
createClassDescriptor(ClassMapping classMapping)
|
protected FieldDescriptorImpl |
createFieldDesc(java.lang.Class javaClass,
FieldMapping fieldMap)
Creates a single field descriptor. |
static java.lang.String |
definition2param(java.lang.String sqlTypeDef)
Extracts parameter for type convertor from the SQL type definition of the form "SQL_TYPE_NAME[PARAMETER]". |
static java.lang.String |
definition2type(java.lang.String sqlTypeDef)
Extracts SQL type name from the the SQL type definition of the form "SQL_TYPE_NAME[PARAMETER]". |
protected FieldDescriptor |
findIdentityByName(java.util.List<FieldDescriptor> fldList,
java.lang.String idName,
java.lang.Class javaClass)
|
BindingType |
getBindingType()
|
protected java.lang.String[] |
getSqlTypes(FieldMapping fieldMap)
Parse the sql type attribute to build an array of types, needed to support whitespace inside parameterized types (see Bug 1045). |
protected TypeInfo |
getTypeInfo(java.lang.Class fieldType,
CollectionHandler colHandler,
FieldMapping fieldMap)
|
void |
loadMapping(MappingRoot mapping,
java.lang.Object param)
Loads the mapping from the specified mapping object if not loaded previously. |
protected void |
resolveRelations(ClassDescriptor clsDesc)
Walks through all fields of a descriptor and resolves relation ClassDescriptor s by using mapping information or, if not
present, resolution by file to support generated
ClassDescriptor s. |
Methods inherited from class org.exolab.castor.mapping.loader.AbstractMappingLoader |
---|
checkFieldNameDuplicates, createClassDescriptors, createFieldDescriptors, createFieldHandler, createFieldHandlers, divideFieldDescriptors, findAccessor, getDepended, getExtended, getIdColumnIndex, getIdentityColumnNames, getInternalContext, getOrigin, getSourceType, isPrimitive, resolveType, setInternalContext |
Methods inherited from class org.exolab.castor.mapping.loader.AbstractMappingLoader2 |
---|
addDescriptor, clear, descriptorIterator, getClassLoader, getDescriptor, getDescriptors, isAllowRedefinition, loadMapping, setAllowRedefinitions, setClassLoader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JDOMappingLoader(java.lang.ClassLoader loader)
JDOMappingLoader
, providing a
ClassLoader
instance.
loader
- A Custom ClassLoader
instance.Method Detail |
---|
public static java.lang.String definition2param(java.lang.String sqlTypeDef)
sqlTypeDef
- SQL type definition (e.g. char[01]).
public static java.lang.String definition2type(java.lang.String sqlTypeDef)
sqlTypeDef
- SQL type definition (e.g. char[01]).
public BindingType getBindingType()
public void loadMapping(MappingRoot mapping, java.lang.Object param) throws MappingException
loadMapping
in class AbstractMappingLoader
mapping
- The mapping information.param
- Arbitrary parameter that can be used by subclasses.
MappingException
- The mapping file is invalid.protected ClassDescriptor createClassDescriptor(ClassMapping classMapping) throws MappingException
createClassDescriptor
in class AbstractMappingLoader
MappingException
protected FieldDescriptor findIdentityByName(java.util.List<FieldDescriptor> fldList, java.lang.String idName, java.lang.Class javaClass) throws MappingException
MappingException
protected void resolveRelations(ClassDescriptor clsDesc)
ClassDescriptor
s by using mapping information or, if not
present, resolution by file to support generated
ClassDescriptor
s. Resolved ClassDescriptor
s will be
set as a field's descriptor.
resolveRelations
in class AbstractMappingLoader
clsDesc
- The ClassDescriptor in focus.protected java.lang.String[] getSqlTypes(FieldMapping fieldMap)
protected TypeInfo getTypeInfo(java.lang.Class fieldType, CollectionHandler colHandler, FieldMapping fieldMap) throws MappingException
getTypeInfo
in class AbstractMappingLoader
MappingException
protected FieldDescriptorImpl createFieldDesc(java.lang.Class javaClass, FieldMapping fieldMap) throws MappingException
AbstractMappingLoader
FieldDescriptor
. Implementations may extend this class to create a more
suitable descriptor.
createFieldDesc
in class AbstractMappingLoader
javaClass
- The class to which the field belongs.fieldMap
- The field mapping information.
MappingException
- The field or its accessor methods are not
found, not accessible, not of the specified type, etc.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |