|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jdbcexporter.EntityExporter
The EntityExporter class exports an entity into the database using a given export engine. It ensures that all the columns for the entity have their SQL Types defined properly. The data is formatted using the DelimiterFormatter defined by the EntityDef. Each column value may be transformed by a ColumnTranslator before the current row is passed to the ExportEngine.
Field Summary | |
protected ExportEngine |
defaultEngine
The export engine. |
protected java.util.List |
exportListeners
The list of export listeners. |
protected static org.apache.commons.logging.Log |
LOG
The log for debug information. |
Constructor Summary | |
EntityExporter()
|
Method Summary | |
void |
addExportListener(ExportListener listener)
Adds an export listener. |
protected void |
fillInColumnTypes(ExportEntityDef entityDef)
Fill in the column SQL Types that are missing. |
protected ColumnValue[] |
fillInValues(ExportEntityDef entityDef,
ColumnValue[] values)
Returns the transformed column values. |
protected void |
fireExportEntityRowEvent(ExportEntityRowEvent e)
Fire an export entity row event to the listeners. |
void |
processEntity(ExportEntityDef entityDef)
Process the given entity definition by ensuring that all columns defined have an SQL Type, applying any ColumnTranslator to each column value, formatting the rows with the appropriate DelimiterFormatter and using the ExportEngine to export the row to a file. |
void |
removeExportListener(ExportListener listener)
Removes an export listener. |
void |
setExportEngine(ExportEngine newEngine)
Sets the export engine. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.commons.logging.Log LOG
protected ExportEngine defaultEngine
protected java.util.List exportListeners
Constructor Detail |
public EntityExporter()
Method Detail |
public void setExportEngine(ExportEngine newEngine)
newEngine
- export enginepublic void processEntity(ExportEntityDef entityDef) throws java.sql.SQLException, java.io.IOException
entityDef
- entity definition to export.
java.sql.SQLException
java.io.IOException
public void addExportListener(ExportListener listener)
listener
- the listenerpublic void removeExportListener(ExportListener listener)
listener
- the listenerprotected void fillInColumnTypes(ExportEntityDef entityDef) throws java.sql.SQLException
entityDef
- the entity definition
java.sql.SQLException
- if the column SQL Types could not be retrieved from the
database metaprotected ColumnValue[] fillInValues(ExportEntityDef entityDef, ColumnValue[] values) throws MalformedDataException
entityDef
- the entity definitionvalues
- the rows' values
MalformedDataException
- if the rows' values are incorrectprotected void fireExportEntityRowEvent(ExportEntityRowEvent e)
e
- the export entity row event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |