libgdamm Reference Documentation |
Inheritance diagram for Gnome::Gda::DataModelQuery:
Public Member Functions | |
bool | compute_modification_queries (const Glib::ustring& target, DataModelQueryOptions options) |
Try to compute the INSERT, DELETE and UPDATE queries; any previous modification query will be discarded. | |
Glib::RefPtr<const ParameterList> | get_parameter_list () const |
If some parameters are required to execute the SELECT query used in the model data model, then Returns: a Gda::ParameterList object, or 0 . | |
Glib::RefPtr<ParameterList> | get_parameter_list () |
If some parameters are required to execute the SELECT query used in the model data model, then Returns: a Gda::ParameterList object, or 0 . | |
const GdaDataModelQuery* | gobj () const |
Provides access to the underlying C GObject. | |
GdaDataModelQuery* | gobj () |
Provides access to the underlying C GObject. | |
GdaDataModelQuery* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
bool | query_refresh () |
(Re)-runs the SELECT query to update the contents of model | |
bool | set_modification_query (const Glib::ustring& query) |
Sets the modification query to be used by model to actually perform any change to the dataset in the database. | |
virtual | ~DataModelQuery () |
Static Public Member Functions | |
static Glib::RefPtr<DataModelQuery> | create (Glib::RefPtr<Query>& query) |
Protected Member Functions | |
DataModelQuery (const Glib::RefPtr<Query>& query) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gnome::Gda::DataModelQuery> | wrap (GdaDataModelQuery* object, bool take_copy=false) |
A Glib::wrap() method for this object. |
The DataModelQuery data model simply stores the values returned by a SELECT query. The connection used to execute the SELECT query (given when the object is constructed) is the same as the one provided the Dict object to which the query relates.
virtual Gnome::Gda::DataModelQuery::~DataModelQuery | ( | ) | [virtual] |
Gnome::Gda::DataModelQuery::DataModelQuery | ( | const Glib::RefPtr<Query>& | query | ) | [explicit, protected] |
bool Gnome::Gda::DataModelQuery::compute_modification_queries | ( | const Glib::ustring & | target, | |
DataModelQueryOptions | options | |||
) |
Try to compute the INSERT, DELETE and UPDATE queries; any previous modification query will be discarded.
If specified, the table which will be updated is the one represented by the target.
If target is 0
, then an error will be returned if model's SELECT query has more than one target.
target | The target table to modify, or 0 . | |
options | Options to specify how the queries must be built in some special cases. |
true
if the INSERT, DELETE and UPDATE queries have been computed. static Glib::RefPtr<DataModelQuery> Gnome::Gda::DataModelQuery::create | ( | Glib::RefPtr<Query>& | query | ) | [static] |
Glib::RefPtr<const ParameterList> Gnome::Gda::DataModelQuery::get_parameter_list | ( | ) | const |
If some parameters are required to execute the SELECT query used in the model data model, then Returns: a Gda::ParameterList object, or 0
.
0
. Glib::RefPtr<ParameterList> Gnome::Gda::DataModelQuery::get_parameter_list | ( | ) |
If some parameters are required to execute the SELECT query used in the model data model, then Returns: a Gda::ParameterList object, or 0
.
0
. const GdaDataModelQuery* Gnome::Gda::DataModelQuery::gobj | ( | ) | const [inline] |
GdaDataModelQuery* Gnome::Gda::DataModelQuery::gobj | ( | ) | [inline] |
GdaDataModelQuery* Gnome::Gda::DataModelQuery::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Reimplemented from Gnome::Gda::Object.
bool Gnome::Gda::DataModelQuery::query_refresh | ( | ) |
(Re)-runs the SELECT query to update the contents of model
true
if no error occurred. bool Gnome::Gda::DataModelQuery::set_modification_query | ( | const Glib::ustring & | query | ) |
Sets the modification query to be used by model to actually perform any change to the dataset in the database.
The provided query (the query SQL) must be either a INSERT, UPDATE or DELETE query. It can contain parameters, and the parameters named '[+-]<num>' will be replaced when the query is run: <itemizedlist> <listitem>a parameter named +<num> will take the new value set at the <num>th column in model</listitem> <listitem>a parameter named -<num> will take the old value set at the <num>th column in model</listitem> </itemizedlist> Please note that the "+0" and "-0" parameters names are valid and will respectively take the new and old values of the first column of model.
Examples of queries are: "INSERT INTO orders (customer, creation_date, delivery_before, delivery_date) VALUES (## / *name:'Customer' type:integer* /, date('now'), ## / *name:"+2" type:date nullok:true
* /, 0
)", "DELETE FROM orders WHERE id = ## / *name:"-0" type:integer* /" and "UPDATE orders set id=## / *name:"+0" type:integer* /, delivery_before=## / *name:"+2" type:date nullok:true
* /, delivery_date=## / *name:"+3" type:date nullok:true
* / WHERE id=## / *name:"-0" type:integer* /"
query | The SQL code for a query. |
true
if no error occurred.
Glib::RefPtr<Gnome::Gda::DataModelQuery> wrap | ( | GdaDataModelQuery * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |