Class IntraDatabaseEntityGraph
java.lang.Object
net.sf.jailer.entitygraph.EntityGraph
net.sf.jailer.entitygraph.remote.RemoteEntityGraph
net.sf.jailer.entitygraph.intradatabase.IntraDatabaseEntityGraph
Specialized
RemoteEntityGraph for exporting data into a different
schema within the same database.- Author:
- Ralf Wisser
-
Field Summary
Fields inherited from class net.sf.jailer.entitygraph.remote.RemoteEntityGraph
birthdayOfSubject, rowIdSupport, session, universalPrimaryKeyFields inherited from class net.sf.jailer.entitygraph.EntityGraph
dataModel, DEPENDENCY, ENTITY, ENTITY_GRAPH, ENTITY_SET_ELEMENT, executionContext, graphID, importFilterManager, inDeleteMode, isTruncated -
Method Summary
Modifier and TypeMethodDescriptionCopies an entity-graph.static IntraDatabaseEntityGraphcreate(DataModel dataModel, int graphID, Session session, PrimaryKey universalPrimaryKey, Runnable updateStatistics, ExecutionContext executionContext) Creates a new entity-graph.Creates a new entity-graph of same type and session.voiddropMappingTables(OutputStreamWriter result, DBMS targetDBMSConfiguration) Creates the DROP-statements for the mapping tables.voidfillAndWriteMappingTables(JobManager jobManager, OutputStreamWriter receiptWriter, int numberOfEntities, Session targetSession, DBMS targetDBMSConfiguration, DBMS dbmsConfiguration) Insert the values of columns with non-derived-import-filters into the local database.voidreadEntities(Table table, boolean orderByPK) Reads all entities of a given table.voidreadMarkedEntities(Table table, boolean orderByPK) Reads all entities of a given table which are marked as independent or as roots.voidupdateEntities(Table table, Set<Column> columns, OutputStreamWriter scriptFileWriter, DBMS targetConfiguration, boolean inSourceSchema, String reason) Updates columns of a table.Methods inherited from class net.sf.jailer.entitygraph.remote.RemoteEntityGraph
addDependencies, addEntities, addEntities, close, countEntities, delete, deleteEntities, deleteIndependentEntities, filteredSelectionClause, filteredSelectionClause, getAge, getDatamodel, getDistinctDependencyIDs, getSession, getSize, getSize, getTargetSession, getTotalRowcount, getUniversalPrimaryKey, init, markDependentEntitiesAsTraversed, markIndependentEntities, markRoots, pkEqualsEntityID, prefixColumnName, readDependentEntities, readEntities, readMarkedEntities, readNonTraversedDependencies, readUnfilteredEntityColumns, removeAssociatedDestinations, removeReflexiveDependencies, resolveAssociation, resolveAssociation, setAge, setBirthdayOfSubject, shutDownMethods inherited from class net.sf.jailer.entitygraph.EntityGraph
addExportedCount, checkExist, copy, createUniqueGraphID, delete, deleteRows, dmlTableReference, getExportedCount, getImportFilterManager, getSelectionClause, getTransformerFactory, incLobCount, removeDependencies, setDeleteMode, setImportFilterManager, setTransformerFactory, truncate, typeName
-
Method Details
-
create
public static IntraDatabaseEntityGraph create(DataModel dataModel, int graphID, Session session, PrimaryKey universalPrimaryKey, Runnable updateStatistics, ExecutionContext executionContext) throws SQLException Creates a new entity-graph.- Parameters:
graphID- the unique ID of the graphsession- for executing SQL-StatementsuniversalPrimaryKey- the universal primary key- Returns:
- the newly created entity-graph
- Throws:
SQLException
-
copy
Copies an entity-graph.- Overrides:
copyin classRemoteEntityGraph- Parameters:
newGraphID- the unique ID of the new graphsession- for executing SQL-Statements- Returns:
- the newly created entity-graph
- Throws:
SQLException
-
createNewGraph
Creates a new entity-graph of same type and session.- Overrides:
createNewGraphin classRemoteEntityGraph- Returns:
- the newly created entity-graph
- Throws:
SQLException
-
readMarkedEntities
Reads all entities of a given table which are marked as independent or as roots.- Overrides:
readMarkedEntitiesin classRemoteEntityGraph- Parameters:
table- the tableorderByPK- not used- Throws:
SQLException
-
readEntities
Reads all entities of a given table.- Overrides:
readEntitiesin classRemoteEntityGraph- Parameters:
table- the tableorderByPK- not used- Throws:
SQLException
-
updateEntities
public void updateEntities(Table table, Set<Column> columns, OutputStreamWriter scriptFileWriter, DBMS targetConfiguration, boolean inSourceSchema, String reason) throws SQLException Updates columns of a table.- Overrides:
updateEntitiesin classRemoteEntityGraph- Parameters:
table- the tablecolumns- the columnsscriptFileWriter- writer for the SQL script outputtargetConfiguration- the target DBMS configurationinSourceSchema- iftrue, use source-schema-mapping, else use schema-mappingreason- to be written as comment- Throws:
SQLException
-
fillAndWriteMappingTables
public void fillAndWriteMappingTables(JobManager jobManager, OutputStreamWriter receiptWriter, int numberOfEntities, Session targetSession, DBMS targetDBMSConfiguration, DBMS dbmsConfiguration) throws IOException, SQLException Insert the values of columns with non-derived-import-filters into the local database.- Overrides:
fillAndWriteMappingTablesin classEntityGraph- Parameters:
jobManager- the job manager used to execute jobs in parallelreceiptWriter- writer for the DML result outputnumberOfEntities- the number of entities to processtargetSession- the session for the target databasetargetDBMSConfiguration- the target DBMS configurationdbmsConfiguration- the source DBMS configuration- Throws:
IOExceptionSQLException
-
dropMappingTables
public void dropMappingTables(OutputStreamWriter result, DBMS targetDBMSConfiguration) throws IOException, SQLException Creates the DROP-statements for the mapping tables.- Overrides:
dropMappingTablesin classEntityGraph- Parameters:
result- writer for the DROP-statement outputtargetDBMSConfiguration- the target DBMS configuration- Throws:
IOExceptionSQLException
-