![]() | ![]() | ![]() | Libmergeant Reference Manual | ![]() |
---|
#define MG_TARGET_TYPE #define MG_TARGET (obj) #define IS_MG_TARGET (obj) #define MG_TARGET_CLASS (klass) struct MgTarget; guint mg_target_get_type (void); GObject* mg_target_new_with_entity (MgQuery *query, MgEntity *entity); GObject* mg_target_new_with_xml_id (MgQuery *query, const gchar *entity_xml_id); GObject* mg_target_new_copy (MgTarget *orig); MgQuery* mg_target_get_query (MgTarget *target); MgEntity* mg_target_get_represented_entity (MgTarget *target); void mg_target_set_alias (MgTarget *target, const gchar *alias); const gchar* mg_target_get_alias (MgTarget *target);
A MgTarget object represents an entity (usually a table, as a MgDbTable) which is taking part in a query. For SELECT queries, the targets are the entities listed after the FROM clause; for the INSERT, DELETE and UPDATE queries, there is only one target which is the entity to which the modifications apply.
Within a single SELECT query, there can be more than one MgTarget object representing the same entity for queries making usage of an entity more than one time.
It implements the MgXmlStorage, MgReferer and MgRenderer interfaces.
#define MG_TARGET(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, mg_target_get_type(), MgTarget)
obj : |
|
#define IS_MG_TARGET(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, mg_target_get_type ())
obj : |
|
#define MG_TARGET_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, mg_target_get_type (), MgTargetClass)
klass : |
|
GObject* mg_target_new_with_entity (MgQuery *query, MgEntity *entity);
Creates a new MgTarget object, specifying the MgEntity to represent
query : | a MgQuery object |
entity : | an object implementing the MgEntity interface |
Returns : | the new object |
GObject* mg_target_new_with_xml_id (MgQuery *query, const gchar *entity_xml_id);
Creates a new MgTarget object, specifying the XML id of the MgEntity to represent
query : | a MgQuery object |
entity_xml_id : | the XML Id of an object implementing the MgEntity interface |
Returns : | the new object |
GObject* mg_target_new_copy (MgTarget *orig);
Makes a copy of an existing object (copy constructor)
orig : | a MgTarget object to copy |
Returns : | the new object |
MgQuery* mg_target_get_query (MgTarget *target);
Get the MgQuery in which target is
target : | a MgTarget object |
Returns : | the MgQuery object |
MgEntity* mg_target_get_represented_entity (MgTarget *target);
Get the MgEntity object which is represented by target
target : | a MgTarget object |
Returns : | the MgEntity object or NULL if target is not active |
void mg_target_set_alias (MgTarget *target, const gchar *alias);
Sets target's alias to alias
target : | a MgTarget object |
alias : | the alias |
<<< MgQuery | Query fields >>> |