Load all objects of m_type in the database into memory.
139 gnc_commodity_table* pTable;
142 std::string sql(
"SELECT * FROM " COMMODITIES_TABLE);
143 auto stmt = sql_be->create_statement_from_sql(sql);
146 for (
auto row : *result)
148 auto pCommodity = load_single_commodity (sql_be, row);
150 if (pCommodity != NULL)
158 qof_instance_set_guid (QOF_INSTANCE (pCommodity), &guid);
162 std::string pkey(col_table[0]->name());
163 sql =
"SELECT DISTINCT ";
164 sql += pkey +
" FROM " COMMODITIES_TABLE;
166 (BookLookupFn)gnc_commodity_find_commodity_by_guid);
gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table *table, gnc_commodity *comm)
Add a new commodity to the commodity table.
gnc_commodity_table * gnc_commodity_table_get_table(QofBook *book)
Returns the commodity table associated with a book.
GncSqlResultPtr execute_select_statement(const GncSqlStatementPtr &stmt) const noexcept
Executes an SQL SELECT statement and returns the result rows.
const GncGUID * qof_instance_get_guid(gconstpointer inst)
Return the GncGUID of this instance.
#define qof_instance_is_dirty
Return value of is_dirty flag.
void gnc_sql_slots_load_for_sql_subquery(GncSqlBackend *sql_be, const std::string subquery, BookLookupFn lookup_fn)
gnc_sql_slots_load_for_sql_subquery - Loads slots for all objects whose guid is supplied by a subquer...
void commodity_for_postload_processing(gnc_commodity *)
Register a commodity to be committed after loading is complete.
The type used to store guids in C.