GdaQueryTarget

## GdaQueryTarget GdaQueryTarget — Represents a target entity within a query. |

## Synopsis

                GdaQueryTarget;
    enum        GdaQueryTargetType;
    GObject*    gda_query_target_new            (GdaQuery *query,
                                                 const gchar *table);
    GObject*    gda_query_target_new_copy       (GdaQueryTarget *orig);
    GdaQuery*   gda_query_target_get_query      (GdaQueryTarget *target);
    const gchar* gda_query_target_get_represented_table_name
                                                (GdaQueryTarget *target);
    GdaEntity*  gda_query_target_get_represented_entity
                                                (GdaQueryTarget *target);
    void        gda_query_target_set_alias      (GdaQueryTarget *target,
                                                 const gchar *alias);
    const gchar* gda_query_target_get_alias     (GdaQueryTarget *target);
    gchar*      gda_query_target_get_complete_name
                                                (GdaQueryTarget *target);

## Object Hierarchy

      GObject
       +----GdaObject
             +----GdaQueryObject
                   +----GdaQueryTarget

## Implemented Interfaces

GdaQueryTarget implements GdaXmlStorage, GdaReferer and GdaRenderer.

## Properties

      "entity"               gpointer              : Read / Write
      "entity-id"            gchararray            : Write
      "entity-name"          gchararray            : Write
      "query"                gpointer              : Read / Write / Construct Only

## Description

A GdaQueryTarget object represents an entity (usually a table, as a GdaDictTable) 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 GdaQueryTarget object representing the same entity for queries making usage of an entity more than one time.

It implements the GdaXmlStorage, GdaReferer and GdaRenderer interfaces.

## Details

### GdaQueryTarget

    typedef struct _GdaQueryTarget GdaQueryTarget;

### enum GdaQueryTargetType

    typedef enum {
            GDA_QUERY_TARGET_TYPE_INNER,
    	GDA_QUERY_TARGET_TYPE_LEFT_OUTER,
    	GDA_QUERY_TARGET_TYPE_RIGHT_OUTER,
    	GDA_QUERY_TARGET_TYPE_FULL_OUTER,
            GDA_QUERY_TARGET_TYPE_CROSS,
            GDA_QUERY_TARGET_TYPE_LAST
    } GdaQueryTargetType;

### gda_query_target_new ()

    GObject*    gda_query_target_new            (GdaQuery *query,
                                                 const gchar *table);

Creates a new GdaQueryTarget object, specifying the name of the table to reference.

`query` : | a GdaQuery object
`table` : | the name of the table to reference
Returns : | the new object

### gda_query_target_new_copy ()

    GObject*    gda_query_target_new_copy       (GdaQueryTarget *orig);

Makes a copy of an existing object (copy constructor)

`orig` : | a GdaQueryTarget object to copy
Returns : | the new object

### gda_query_target_get_query ()

    GdaQuery*   gda_query_target_get_query      (GdaQueryTarget *target);

Get the GdaQuery in which `target` is

`target` : | a GdaQueryTarget object
Returns : | the GdaQuery object

### gda_query_target_get_represented_table_name ()

    const gchar* gda_query_target_get_represented_table_name
                                                (GdaQueryTarget *target);

Get the table name represented by `target`

`target` : | a GdaQueryTarget object
Returns : | the table name or NULL if `target` does not represent a database table

### gda_query_target_get_represented_entity ()

    GdaEntity*  gda_query_target_get_represented_entity
                                                (GdaQueryTarget *target);

Get the GdaEntity object which is represented by `target`

`target` : | a GdaQueryTarget object
Returns : | the GdaEntity object or NULL if `target` is not active

### gda_query_target_set_alias ()

    void        gda_query_target_set_alias      (GdaQueryTarget *target,
                                                 const gchar *alias);

Sets `target`'s alias to `alias`

`target` : | a GdaQueryTarget object
`alias` : | the alias

### gda_query_target_get_alias ()

    const gchar* gda_query_target_get_alias     (GdaQueryTarget *target);

Get `target`'s alias

`target` : | a GdaQueryTarget object
Returns : | the alias

### gda_query_target_get_complete_name ()

    gchar*      gda_query_target_get_complete_name
                                                (GdaQueryTarget *target);

Get a complete name for target in the form of "<entity name> AS <target alias>"

`target` : | a GdaQueryTarget object
Returns : | a new string

## Properties

### The "`entity`" property

      "entity"               gpointer              : Read / Write

### The "`entity-id`" property

      "entity-id"            gchararray            : Write

Default value: NULL

### The "`entity-name`" property

      "entity-name"          gchararray            : Write

Default value: NULL

### The "`query`" property

      "query"                gpointer              : Read / Write / Construct Only