|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.kernel.EmbeddedComponent
com.jcorporate.expresso.core.db.TypeMapper
Type Mapper takes care of the job of mapping various Java types to SQL types. This, in turn, is used by items like DBCreate, Database Verifier, etc. The type mapper is embedded within the PersistenceManager.
PersistenceManager,
Serialized Form| Constructor Summary | |
|
TypeMapper()
Default constructor. |
protected |
TypeMapper(String thedataContext)
Constructor that initializes the type mapper based upon the data context |
| Method Summary | |
void |
configure(Configuration newConfig)
Sets up all the types now that we know the parent's data context. |
void |
destroy()
Destroys the component. |
Integer |
getExpressoToJava(String dbFieldType)
Retrieve a DBField to java.sql.Types mapping value. |
Map |
getExpressoToSQLMap()
Get the ExpressoToSQL Map |
static TypeMapper |
getInstance(String dataContext)
Retrieves an instance of the type mapper. |
int |
getJavaSQLType(String fieldType)
Return a java.sql.Types integer that maps to the field type listed |
String |
getMetadataName()
Because we look up our metadata in the parent component, we have to somehow know WHAT component's metadata is ours. |
String |
getNameForSQL(int sqlType)
Get the actual java.sql.Type in a friendly String name |
Map |
getSQLToDBMap()
Get the SQL to Database type Map |
String |
getTypeForDB(String expressoType)
Map a type used in Expresso to an appropriate database-specific type, utilizing the default type mapping followed by the custom type mapping(s) for this context (if any) |
String |
getTypeForExpresso(int sqlType)
Map a type used in SQL to an appropriate expresso-specific type |
String |
getTypeForSQL(int sqlType)
Retrieve a 'friendly' name for a java.sql.Type integer |
void |
initialize()
Any quick initializations here. |
protected void |
initializeTypes(String dataContext)
Initialize the mappings between java types, expresso types, and SQL types. |
void |
reconfigure(Configuration newConfig)
Reconfigures the TypeMapper. |
| Methods inherited from class com.jcorporate.expresso.kernel.EmbeddedComponent |
getMetaData, getParent, setParent |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TypeMapper()
protected TypeMapper(String thedataContext)
thedataContext - the dataContext to load the Type Mapping for| Method Detail |
public Integer getExpressoToJava(String dbFieldType)
dbFieldType - the DBField data type
public Map getExpressoToSQLMap()
public static TypeMapper getInstance(String dataContext)
throws DBException
dataContext - the data context to retrieve it for.
DBException - upon error getting or initializing the TypeMapper
for that context
public int getJavaSQLType(String fieldType)
throws DBException
fieldType - the type of the field to map.
DBException - if there was an error initializing the ExpressoToSQL
maps.public String getMetadataName()
getMetadataName in class EmbeddedComponentpublic String getNameForSQL(int sqlType)
sqlType - java.sql.Type integer
public Map getSQLToDBMap()
public String getTypeForDB(String expressoType)
throws DBException
expressoType - The java.sql datatype to check against.
DBException - If there's an getting the datatype.
public String getTypeForExpresso(int sqlType)
throws DBException
sqlType - The java.sql datatype to check against.
DBException - If there's an getting the datatype.public String getTypeForSQL(int sqlType)
sqlType - the java.sql.Types integer value
public void configure(Configuration newConfig)
throws ConfigurationException
configure in interface ComponentLifecyclenewConfig - Configuration settings.
ConfigurationException - upon errorpublic void destroy()
destroy in interface ComponentLifecyclepublic void initialize()
initialize in interface ComponentLifecycle
public void reconfigure(Configuration newConfig)
throws ConfigurationException
reconfigure in interface ComponentLifecyclenewConfig - the new Configuration bean.
ConfigurationException - upon reconfiguration error.
protected void initializeTypes(String dataContext)
throws DBException
dataContext - the data context to map for
DBException - upon error
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||