]> saetta.ns0.it Git - libgdaex/commitdiff
Added and managed decode_join_type on GdaExQueryEditorField.
authorAndrea Zagli <azagli@libero.it>
Sat, 22 Oct 2011 10:46:27 +0000 (12:46 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 22 Oct 2011 10:46:27 +0000 (12:46 +0200)
src/queryeditor.c
src/queryeditor.h
tests/query_editor.c

index 7d6f5c8be56ec56f9d19b8c5d998d800a8b5d963..2fb48ca5510f2e5c8b36a54c3628844b7df550bd 100644 (file)
@@ -745,7 +745,8 @@ GdaSqlBuilder
                                                                                              id_join1, id_join2, 0);
 
                                                        gda_sql_builder_select_join_targets (sqlbuilder, id_target1, id_target2,
-                                                                                            GDA_SQL_SELECT_JOIN_INNER, join_cond);
+                                                                                            field->decode_join_type == GDAEX_QE_JOIN_TYPE_LEFT ? GDA_SQL_SELECT_JOIN_LEFT : GDA_SQL_SELECT_JOIN_INNER,
+                                                                                            join_cond);
                                                        gda_sql_builder_select_add_field (sqlbuilder, field->decode_field_to_show,
                                                                                          field->decode_table2,
                                                                                          alias != NULL && g_strcmp0 (alias, "") != 0 ? alias : field->decode_field_alias);
index 2a658c6101cb00e61e1dda881515e43d70e58f3a..6e653f53fcf63d34cbb35ead17455f44b6635734 100644 (file)
@@ -92,6 +92,12 @@ typedef enum
                GDAEX_QE_WHERE_TYPE_IS_NULL = 4096
        } GdaExQueryEditorWhereType;
 
+typedef enum
+       {
+               GDAEX_QE_JOIN_TYPE_INNER,
+               GDAEX_QE_JOIN_TYPE_LEFT
+       } GdaExQueryEditorJoinType;
+
 #define GDAEX_QE_WHERE_TYPE_STRING GDAEX_QE_WHERE_TYPE_STARTS | GDAEX_QE_WHERE_TYPE_CONTAINS | GDAEX_QE_WHERE_TYPE_ENDS | GDAEX_QE_WHERE_TYPE_ISTARTS | GDAEX_QE_WHERE_TYPE_ICONTAINS | GDAEX_QE_WHERE_TYPE_IENDS
 
 #define GDAEX_QE_WHERE_TYPE_NUMBER GDAEX_QE_WHERE_TYPE_EQUAL | GDAEX_QE_WHERE_TYPE_GREAT | GDAEX_QE_WHERE_TYPE_GREAT_EQUAL | GDAEX_QE_WHERE_TYPE_LESS | GDAEX_QE_WHERE_TYPE_LESS_EQUAL | GDAEX_QE_WHERE_TYPE_BETWEEN
@@ -116,6 +122,7 @@ typedef struct
                 * to refactor
                 */
                gchar *decode_table2;
+               GdaExQueryEditorJoinType decode_join_type;
                /* TODO 
                GSList *decode_fields1;
                GSList *decode_fields2;
index 2e557b544f961dd5d19a49590592feced166d3ad..728a9a1669a860527fdb31e173bc5f52c8a29d8a 100644 (file)
@@ -251,6 +251,7 @@ main (int argc, char *argv[])
        field->for_show = TRUE;
        field->for_where = TRUE;
        field->decode_table2 = g_strdup ("cities");
+       field->decode_join_type = GDAEX_QE_JOIN_TYPE_LEFT;
        /*field->decode_fields1 = g_slist_append (field->decode_fields1, "id_cities");
        field->decode_fields2 = g_slist_append (field->decode_fields2, "id");*/
        field->decode_field2 = g_strdup ("id");