| 336 | |
| 337 | |
| 338 | void OMSFileLoad::loadProcessingSteps_(IdentificationData& id_data) |
| 339 | { |
| 340 | if (!db_->tableExists("ID_ProcessingStep")) return; |
| 341 | |
| 342 | |
| 343 | SQLite::Statement query(*db_, "SELECT * FROM ID_ProcessingStep"); |
| 344 | SQLite::Statement subquery_file(*db_, ""); |
| 345 | bool have_input_files = db_->tableExists( |
| 346 | "ID_ProcessingStep_InputFile"); |
| 347 | if (have_input_files) |
| 348 | { |
| 349 | subquery_file = SQLite::Statement(*db_, "SELECT input_file_id " \ |
| 350 | "FROM ID_ProcessingStep_InputFile " \ |
| 351 | "WHERE processing_step_id = :id"); |
| 352 | } |
| 353 | SQLite::Statement subquery_info(*db_, ""); |
| 354 | bool have_meta_info = prepareQueryMetaInfo_(subquery_info, "ID_ProcessingStep"); |
| 355 | while (query.executeStep()) |
| 356 | { |
| 357 | Key id = query.getColumn("id").getInt64(); |
| 358 | Key software_id = query.getColumn("software_id").getInt64(); |
| 359 | ID::ProcessingStep step(processing_software_refs_[software_id]); |
| 360 | String date_time = query.getColumn("date_time").getString(); |
| 361 | if (!date_time.empty()) step.date_time.set(date_time); |
| 362 | if (have_input_files) |
| 363 | { |
| 364 | subquery_file.bind(":id", id); |
| 365 | while (subquery_file.executeStep()) |
| 366 | { |
| 367 | Key input_file_id = subquery_file.getColumn(0).getInt64(); |
| 368 | // the foreign key constraint should ensure that look-up succeeds: |
| 369 | step.input_file_refs.push_back(input_file_refs_[input_file_id]); |
| 370 | } |
| 371 | subquery_file.reset(); // get ready for new executeStep() |
| 372 | } |
| 373 | if (have_meta_info) |
| 374 | { |
| 375 | handleQueryMetaInfo_(subquery_info, step, id); |
| 376 | } |
| 377 | ID::ProcessingStepRef ref; |
| 378 | auto opt_search_param_id = query.getColumn("search_param_id"); |
| 379 | if (opt_search_param_id.isNull()) // no DB search params available |
| 380 | { |
| 381 | ref = id_data.registerProcessingStep(step); |
| 382 | } |
| 383 | else |
| 384 | { |
| 385 | ID::SearchParamRef search_param_ref = |
| 386 | search_param_refs_[opt_search_param_id.getInt64()]; |
| 387 | ref = id_data.registerProcessingStep(step, search_param_ref); |
| 388 | } |
| 389 | processing_step_refs_[id] = ref; |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | |
| 394 | void OMSFileLoad::loadObservations_(IdentificationData& id_data) |
nothing calls this directly
no test coverage detected