org.exolab.castor.jdo.engine
Class JDOMappingLoader
java.lang.Object
org.exolab.castor.mapping.loader.AbstractMappingLoader2
org.exolab.castor.mapping.loader.AbstractMappingLoader
org.exolab.castor.jdo.engine.JDOMappingLoader
- All Implemented Interfaces:
- MappingLoader
- public final class JDOMappingLoader
- extends AbstractMappingLoader
A JDO implementation of mapping helper. Creates JDO class descriptors
from the mapping file.
- Version:
- $Revision: 6774 $ $Date: 2006-04-13 07:37:49 -0600 (Thu, 13 Apr 2006) $
- Author:
- Assaf Arkin, Ralf Joachim
| Methods inherited from class org.exolab.castor.mapping.loader.AbstractMappingLoader |
checkFieldNameDuplicates, createClassDescriptors, createFieldDescriptors, createFieldHandler, divideFieldDescriptors, findAccessor, getDepended, getExtended, getIdColumnIndex, getIdentityColumnNames, getOrigin, getSourceType, isPrimitive, resolveType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDOMappingLoader
public JDOMappingLoader(java.lang.ClassLoader loader)
definition2param
public 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]". If the type is not parameterized, returns
null.
- Parameters:
sqlTypeDef - SQL type definition (e.g. char[01]).
- Returns:
- Parameter (e.g. "01") or null if not parameterized.
definition2type
public 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]".
- Parameters:
sqlTypeDef - SQL type definition (e.g. char[01]).
- Returns:
- SQL type name (e.g. "char").
getBindingType
public BindingType getBindingType()
-
loadMapping
public void loadMapping(MappingRoot mapping,
java.lang.Object param)
throws MappingException
- Loads the mapping from the specified mapping object if not loaded previously.
- Specified by:
loadMapping in class AbstractMappingLoader
- Parameters:
mapping - The mapping information.param - Arbitrary parameter that can be used by subclasses.
- Throws:
MappingException - The mapping file is invalid.
createClassDescriptor
protected final ClassDescriptor createClassDescriptor(ClassMapping clsMap)
throws MappingException
- Specified by:
createClassDescriptor in class AbstractMappingLoader
- Throws:
MappingException
findIdentityByName
protected final FieldDescriptor findIdentityByName(java.util.List fldList,
java.lang.String idName,
java.lang.Class javaClass)
throws MappingException
- Throws:
MappingException
resolveRelations
protected final void resolveRelations(ClassDescriptor clsDesc)
- Specified by:
resolveRelations in class AbstractMappingLoader
getSqlTypes
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)
getTypeInfo
protected TypeInfo getTypeInfo(java.lang.Class fieldType,
CollectionHandler colHandler,
FieldMapping fieldMap)
throws MappingException
- Overrides:
getTypeInfo in class AbstractMappingLoader
- Throws:
MappingException
createFieldDesc
protected AbstractFieldDescriptor createFieldDesc(java.lang.Class javaClass,
FieldMapping fieldMap)
throws MappingException
- Description copied from class:
AbstractMappingLoader
- Creates a single field descriptor. The field mapping is used to create a new stock
FieldDescriptor. Implementations may extend this class to create a more
suitable descriptor.
- Overrides:
createFieldDesc in class AbstractMappingLoader
- Parameters:
javaClass - The class to which the field belongs.fieldMap - The field mapping information.
- Returns:
- The field descriptor.
- Throws:
MappingException - The field or its accessor methods are not
found, not accessible, not of the specified type, etc.
Intalio Inc. (C) 1999-2007. All rights reserved http://www.intalio.com