![]() | ![]() | ![]() | Libmergeant Reference Manual | ![]() |
---|
MgTarget — Represents a target entity within a query.
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.
GObject* mg_target_new_with_entity (MgQuery *query, MgEntity *entity);
Creates a new MgTarget object, specifying the MgEntity to represent
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
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
MgEntity* mg_target_get_represented_entity (MgTarget *target);
Get the MgEntity object which is represented by target
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 >> |