Package net.sf.basedb.core
Class MigrateRbaToDba
java.lang.Object
net.sf.basedb.core.MigrateRbaToDba
- All Implemented Interfaces:
Work
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
Used for adding log entries to the database if that is enabled.static class
Hold information a raw bioassay.static class
Hold the mappings defined in the mapping file. -
Field Summary
Modifier and TypeFieldDescriptionprivate final List<AnnotationBatcher.InsertBatcher>
private final List<AnnotationBatcher.UpdateBatcher>
private final DbControl
private final Dialect
private final LoggingInterceptor
private final MigrateRbaToDba.SubtypeMapping
private final ProgressReporter
private final StatelessSession
-
Constructor Summary
ModifierConstructorDescriptionprivate
MigrateRbaToDba
(DbControl dc, MigrateRbaToDba.SubtypeMapping mapping, ProgressReporter progress) -
Method Summary
Modifier and TypeMethodDescriptionprivate AnnotationBatcher.InsertBatcher
createInsertBatcher
(Connection c, String sql, int... types) private AnnotationBatcher.UpdateBatcher
createUpdateBatcher
(Connection c, String sql, int... types) private void
enableAnnotationTypes
(Connection connection, List<Integer> allAnnotationSets) Make sure that the annotation types that are used by the migrated raw bioassays are enabled for derived bioassays.private void
enableFileTypes
(Connection connection, List<Integer> allFileSets) Make sure that the data file types that are used by the migrated raw bioassays are enabled for derived bioassays.void
execute
(Connection connection) private void
flush()
Flush all batchersprivate void
linkItemValues
(Connection connection, Map<Integer, Integer> rbaToDba) Change raw bioassays that have been used as job parameters to the new derived bioassay.static void
migrateAll
(SessionControl sc, File cfg, boolean dryRun, ProgressReporter progress) private void
updateItemLists
(Connection connection, Map<Integer, Integer> rbaToDba) Update item lists with raw bioassays to item lists with derived bioassays.
-
Field Details
-
dc
-
logInterceptor
-
mapping
-
progress
-
session
-
dialect
-
allInsertBatchers
-
allUpdateBatchers
-
-
Constructor Details
-
MigrateRbaToDba
private MigrateRbaToDba(DbControl dc, MigrateRbaToDba.SubtypeMapping mapping, ProgressReporter progress)
-
-
Method Details
-
migrateAll
public static void migrateAll(SessionControl sc, File cfg, boolean dryRun, ProgressReporter progress) throws SQLException, IOException - Throws:
SQLException
IOException
-
execute
- Specified by:
execute
in interfaceWork
- Throws:
SQLException
-
enableAnnotationTypes
private void enableAnnotationTypes(Connection connection, List<Integer> allAnnotationSets) throws SQLException Make sure that the annotation types that are used by the migrated raw bioassays are enabled for derived bioassays.- Throws:
SQLException
-
enableFileTypes
Make sure that the data file types that are used by the migrated raw bioassays are enabled for derived bioassays.- Throws:
SQLException
-
linkItemValues
private void linkItemValues(Connection connection, Map<Integer, Integer> rbaToDba) throws SQLExceptionChange raw bioassays that have been used as job parameters to the new derived bioassay. It would have been possible to do this per raw bioassay but it goes a lot faster if we can use the 'id' column in the update query.- Throws:
SQLException
-
updateItemLists
private void updateItemLists(Connection connection, Map<Integer, Integer> rbaToDba) throws SQLExceptionUpdate item lists with raw bioassays to item lists with derived bioassays.- Throws:
SQLException
-
createInsertBatcher
private AnnotationBatcher.InsertBatcher createInsertBatcher(Connection c, String sql, int... types) throws SQLException - Throws:
SQLException
-
createUpdateBatcher
private AnnotationBatcher.UpdateBatcher createUpdateBatcher(Connection c, String sql, int... types) throws SQLException - Throws:
SQLException
-
flush
private void flush()Flush all batchers
-