Top | ![]() |
![]() |
![]() |
![]() |
GdaQueryJoin * | gda_query_join_new_with_targets () |
GdaQueryJoin * | gda_query_join_new_with_xml_ids () |
GdaQueryJoin * | gda_query_join_new_copy () |
void | gda_query_join_set_join_type () |
GdaQueryJoinType | gda_query_join_get_join_type () |
GdaQuery * | gda_query_join_get_query () |
GdaQueryTarget * | gda_query_join_get_target_1 () |
GdaQueryTarget * | gda_query_join_get_target_2 () |
void | gda_query_join_swap_targets () |
gboolean | gda_query_join_set_condition_from_fkcons () |
gboolean | gda_query_join_set_condition_from_sql () |
gboolean | gda_query_join_set_condition () |
GdaQueryCondition * | gda_query_join_get_condition () |
const gchar * | gda_query_join_render_type () |
GdaQuery * | query | Read / Write / Construct Only |
GdaQueryTarget * | target1 | Read / Write |
gchar * | target1-id | Write |
GdaQueryTarget * | target2 | Read / Write |
gchar * | target2-id | Write |
This object is a join, within a SELECT query, between two different entities participating in the query; the entoties are themselves represented by GdaQueryTarget objects. It is important to specify joinning conditions as joins and not simply as WHERE conditions because the joins carry more information than a simple condition and because some features of Libmergeant rely on the joins analysis.
It implements the GdaXmlStorage and GdaReferer interfaces.
GdaQueryJoin * gda_query_join_new_with_targets (GdaQuery *query
,GdaQueryTarget *target_1
,GdaQueryTarget *target_2
);
Creates a new GdaQueryJoin object. Note: the GdaQueryTarget ranks (1st and 2nd) does not matter, but is necessary since the join may not be symetrical (LEFT or RIGHT join). Also, the GdaQueryJoin object may decide to swap the two if necessary.
query |
a GdaQuery object in which the join will occur |
|
target_1 |
the 1st GdaQueryTarget object participating in the join |
|
target_2 |
the 2nd GdaQueryTarget object participating in the join |
GdaQueryJoin * gda_query_join_new_with_xml_ids (GdaQuery *query
,const gchar *target_1_xml_id
,const gchar *target_2_xml_id
);
Creates a new GdaQueryJoin object. Note: the GdaQueryTarget ranks (1st and 2nd) does not matter, but is necessary since the join may not be symetrical (LEFT or RIGHT join). Also, the GdaQueryJoin object may decide to swap the two if necessary.
query |
a GdaQuery object in which the join will occur |
|
target_1_xml_id |
the 1st GdaQueryTarget object's XML id participating in the join |
|
target_2_xml_id |
the 2nd GdaQueryTarget object's XML id participating in the join |
GdaQueryJoin * gda_query_join_new_copy (GdaQueryJoin *orig
,GHashTable *replacements
);
Copy constructor
orig |
a GdaQueryJoin to make a copy of |
|
replacements |
a hash table to store replacements, or |
void gda_query_join_set_join_type (GdaQueryJoin *join
,GdaQueryJoinType type
);
Sets the type of join
GdaQueryJoinType
gda_query_join_get_join_type (GdaQueryJoin *join
);
Get the type of a join
GdaQuery *
gda_query_join_get_query (GdaQueryJoin *join
);
Get the GdaQuery to which join
is attached to
GdaQueryTarget *
gda_query_join_get_target_1 (GdaQueryJoin *join
);
Get the 1st GdaQueryTarget participating in the join
GdaQueryTarget *
gda_query_join_get_target_2 (GdaQueryJoin *join
);
Get the 2nd GdaQueryTarget participating in the join
void
gda_query_join_swap_targets (GdaQueryJoin *join
);
Changes the relative roles of the two GdaQueryTarget objects. It does not change the join condition itself, and is usefull only for the internals of the GdaQuery object
gboolean
gda_query_join_set_condition_from_fkcons
(GdaQueryJoin *join
);
Creates a GdaQueryCondition for join
using the foreign key constraints
present in the database if the two targets join
joins are database tables
(GdaDictTable objects).
If there is more than one FK constraint between the database tables, then no join is created, and the call returns FALSE.
gboolean gda_query_join_set_condition_from_sql (GdaQueryJoin *join
,const gchar *cond
,GError **error
);
Parses cond
and if it represents a valid SQL expression to be join
's
condition, then set it to be join
's condition.
gboolean gda_query_join_set_condition (GdaQueryJoin *join
,GdaQueryCondition *cond
);
Sets cond
to be join
's condition. This is possible only if cond
uses
query fields which are either of type GdaQueryFieldField and reference one of the two
targets which join
uses, or any other query field type.
join |
a GdaQueryJoin object |
|
cond |
a GdaQueryCondition object, or |
GdaQueryCondition *
gda_query_join_get_condition (GdaQueryJoin *join
);
Get the join's associated condition
const gchar *
gda_query_join_render_type (GdaQueryJoin *join
);
Get the SQL version of the join type ("INNER JOIN", "LEFT JOIN", etc)
“condition-changed”
signalvoid user_function (GdaQueryJoin *gdaqueryjoin, gpointer user_data)
dbjoin |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“type-changed”
signalvoid user_function (GdaQueryJoin *gdaqueryjoin, gpointer user_data)
dbjoin |
the object which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First