comparison OrthancServer/DatabaseWrapper.cpp @ 199:dfa2899d9960

refactoring cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 27 Nov 2012 16:20:22 +0100
parents 663cc6c46d0a
children 9c58b2b03cf0
comparison
equal deleted inserted replaced
198:663cc6c46d0a 199:dfa2899d9960
459 result.push_back(s.ColumnString(0)); 459 result.push_back(s.ColumnString(0));
460 } 460 }
461 } 461 }
462 462
463 463
464 void DatabaseWrapper::GetChildrenInternalId(std::list<int64_t>& result,
465 int64_t id)
466 {
467 SQLite::Statement s(db_, SQLITE_FROM_HERE, "SELECT a.internalId FROM Resources AS a, Resources AS b "
468 "WHERE a.parentId = b.internalId AND b.internalId = ?");
469 s.BindInt(0, id);
470
471 result.clear();
472
473 while (s.Step())
474 {
475 result.push_back(s.ColumnInt(0));
476 }
477 }
478
479
464 void DatabaseWrapper::LogChange(ChangeType changeType, 480 void DatabaseWrapper::LogChange(ChangeType changeType,
465 int64_t internalId, 481 int64_t internalId,
466 ResourceType resourceType, 482 ResourceType resourceType,
467 const boost::posix_time::ptime& date) 483 const boost::posix_time::ptime& date)
468 { 484 {