| 1135 | } |
| 1136 | |
| 1137 | int SQLiteDB::getRootId(int ohfi) |
| 1138 | { |
| 1139 | QSqlQuery query; |
| 1140 | int root_ohfi = ohfi; |
| 1141 | |
| 1142 | query.prepare("SELECT parent_id FROM adjacent_objects WHERE child_id = :child_id"); |
| 1143 | while(root_ohfi >= OHFI_BASE_VALUE) { |
| 1144 | query.bindValue(0, root_ohfi); |
| 1145 | if(!query.exec() || !query.next()) { |
| 1146 | qDebug() << query.lastError(); |
| 1147 | root_ohfi = 0; |
| 1148 | } else { |
| 1149 | root_ohfi = query.value(0).toInt(); |
| 1150 | } |
| 1151 | } |
| 1152 | return root_ohfi; |
| 1153 | } |
| 1154 | |
| 1155 | int SQLiteDB::getObjectType(int ohfi) |
| 1156 | { |