Load all objects of m_type in the database into memory.
167{
168 g_return_if_fail (sql_be != NULL);
169
170 std::stringstream sql;
171 sql << "SELECT * FROM " << BOOK_TABLE;
172 auto stmt = sql_be->create_statement_from_sql(sql.str());
173 if (stmt != nullptr)
174 {
176 auto row = result->begin();
177
178
179
180
181 if (row == result->end())
182 {
183 sql_be->set_loading(false);
184 commit (sql_be, QOF_INSTANCE (sql_be->book()));
185 sql_be->set_loading(true);
186 }
187 else
188 {
189
190 load_single_book (sql_be, *row);
191 }
192 }
193}
GncSqlResultPtr execute_select_statement(const GncSqlStatementPtr &stmt) const noexcept
Executes an SQL SELECT statement and returns the result rows.
virtual bool commit(GncSqlBackend *sql_be, QofInstance *inst)
UPDATE/INSERT a single instance of m_type_name into the database.