GnuCash
5.6-150-g038405b370+
|
Contains all of the information required to copy information between an object and the database for a specific object property. More...
#include <gnc-sql-column-table-entry.hpp>
Public Member Functions | |
GncSqlColumnTableEntry (const char *name, const GncSqlObjectType type, unsigned int s, int f, const char *gobj_name=nullptr, const char *qof_name=nullptr, QofAccessFunc get=nullptr, QofSetterFunc set=nullptr) | |
virtual void | load (const GncSqlBackend *sql_be, GncSqlRow &row, QofIdTypeConst obj_name, void *pObject) const noexcept=0 |
Load a value into an object from the database row. | |
virtual void | add_to_table (ColVec &vec) const noexcept=0 |
Add a GncSqlColumnInfo structure for the column type to a ColVec. | |
virtual void | add_to_query (QofIdTypeConst obj_name, void *pObject, PairVec &vec) const noexcept=0 |
Add a pair of the table column heading and object's value's string representation to a PairVec; used for constructing WHERE clauses and UPDATE statements. | |
QofAccessFunc | get_getter (QofIdTypeConst obj_name) const noexcept |
Retrieve the getter function depending on whether it's an auto-increment field, a QofClass getter, or a function passed to the constructor. | |
QofSetterFunc | get_setter (QofIdTypeConst obj_name) const noexcept |
Retrieve the setter function depending on whether it's an auto-increment field, a QofClass getter, or a function passed to the constructor. | |
const char * | name () const noexcept |
Retrieve the field name so that we don't need to make create_single_col_select_statement and friend. | |
bool | is_autoincr () const noexcept |
Report if the entry is an auto-increment field. | |
template<typename T > | |
void | load_from_guid_ref (GncSqlRow &row, QofIdTypeConst obj_name, void *pObject, T get_ref) const noexcept |
Protected Member Functions | |
template<typename T > | |
T | get_row_value_from_object (QofIdTypeConst obj_name, const void *pObject) const |
template<typename T > | |
void | add_value_to_vec (QofIdTypeConst obj_name, const void *pObject, PairVec &vec) const |
void | add_objectref_guid_to_query (QofIdTypeConst obj_name, const void *pObject, PairVec &vec) const noexcept |
Adds a name/guid std::pair to a PairVec for creating a query. More... | |
void | add_objectref_guid_to_table (ColVec &vec) const noexcept |
Adds a column info structure for an object reference GncGUID to a ColVec. More... | |
template<> | |
void | add_value_to_vec (QofIdTypeConst obj_name, const void *pObject, PairVec &vec, std::true_type) const |
template<> | |
void | add_value_to_vec (QofIdTypeConst obj_name, const void *pObject, PairVec &vec, std::false_type) const |
Friends | |
template<GncSqlObjectType Otype> | |
class | GncSqlColumnTableEntryImpl |
struct | GncSqlColumnInfo |
Contains all of the information required to copy information between an object and the database for a specific object property.
If an entry contains a gobj_param_name value, this string is used as the property name for a call to g_object_get() or g_object_set(). If the gobj_param_name value is NULL but qof_param_name is not NULL, this value is used as the parameter name for a call to qof_class_get_parameter_getter(). If both of these values are NULL, getter and setter are the addresses of routines to return or set the parameter value, respectively.
The database description for an object consists of an array of GncSqlColumnTableEntry objects, with a final member having col_name == NULL.
Definition at line 126 of file gnc-sql-column-table-entry.hpp.
|
protectednoexcept |
Adds a name/guid std::pair to a PairVec for creating a query.
sql_be | SQL backend struct |
obj_name | QOF object type name |
pObject | Object |
pList | List |
Definition at line 96 of file gnc-sql-column-table-entry.cpp.
|
protectednoexcept |
Adds a column info structure for an object reference GncGUID to a ColVec.
sql_be | SQL backend struct |
pList | List |
Definition at line 111 of file gnc-sql-column-table-entry.cpp.