## GnomeDbTarget

GnomeDbTarget — Represents a target entity within a query.

##

# Synopsis

    struct      GnomeDbTarget;
    GType       gnome_db_target_get_type        (void);
    GObject*    gnome_db_target_new_with_entity (GnomeDbQuery *query,
                                                 GnomeDbEntity *entity);
    GObject*    gnome_db_target_new_with_xml_id (GnomeDbQuery *query,
                                                 const gchar *entity_xml_id);
    GObject*    gnome_db_target_new_copy        (GnomeDbTarget *orig);
    GnomeDbQuery* gnome_db_target_get_query     (GnomeDbTarget *target);
    GnomeDbEntity* gnome_db_target_get_represented_entity
                                                (GnomeDbTarget *target);
    void        gnome_db_target_set_alias       (GnomeDbTarget *target,
                                                 const gchar *alias);
    const gchar* gnome_db_target_get_alias      (GnomeDbTarget *target);
    gchar*      gnome_db_target_get_complete_name
                                                (GnomeDbTarget *target);

## Object Hierarchy

      GObject
       +----GnomeDbBase
             +----GnomeDbTarget

## Implemented Interfaces

GnomeDbTarget implements GnomeDbXmlStorage, GnomeDbRenderer and GnomeDbReferer.

## Properties

      "prop"                 gpointer             : Read / Write

## Description

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

It implements the GnomeDbXmlStorage, GnomeDbReferer and GnomeDbRenderer interfaces.

## Details

### struct GnomeDbTarget

    struct GnomeDbTarget;

### gnome_db_target_get_type ()

    GType       gnome_db_target_get_type        (void);

Returns : |

### gnome_db_target_new_with_entity ()

    GObject*    gnome_db_target_new_with_entity (GnomeDbQuery *query,
                                                 GnomeDbEntity *entity);

Creates a new GnomeDbTarget object, specifying the GnomeDbEntity to represent

`query` : | a GnomeDbQuery object
`entity` : | an object implementing the GnomeDbEntity interface
Returns : | the new object

### gnome_db_target_new_with_xml_id ()

    GObject*    gnome_db_target_new_with_xml_id (GnomeDbQuery *query,
                                                 const gchar *entity_xml_id);

Creates a new GnomeDbTarget object, specifying the XML id of the GnomeDbEntity to represent

`query` : | a GnomeDbQuery object
`entity_xml_id` : | the XML Id of an object implementing the GnomeDbEntity interface
Returns : | the new object

### gnome_db_target_new_copy ()

    GObject*    gnome_db_target_new_copy        (GnomeDbTarget *orig);

Makes a copy of an existing object (copy constructor)

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

### gnome_db_target_get_query ()

    GnomeDbQuery* gnome_db_target_get_query     (GnomeDbTarget *target);

Get the GnomeDbQuery in which `target` is

`target` : | a GnomeDbTarget object
Returns : | the GnomeDbQuery object

### gnome_db_target_get_represented_entity ()

    GnomeDbEntity* gnome_db_target_get_represented_entity
                                                (GnomeDbTarget *target);

Get the GnomeDbEntity object which is represented by `target`

`target` : | a GnomeDbTarget object
Returns : | the GnomeDbEntity object or NULL if `target` is not active

### gnome_db_target_set_alias ()

    void        gnome_db_target_set_alias       (GnomeDbTarget *target,
                                                 const gchar *alias);

Sets `target`'s alias to `alias`

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

### gnome_db_target_get_alias ()

    const gchar* gnome_db_target_get_alias      (GnomeDbTarget *target);

Get `target`'s alias

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

### gnome_db_target_get_complete_name ()

    gchar*      gnome_db_target_get_complete_name
                                                (GnomeDbTarget *target);

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

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

## Properties

"`prop`" (gpointer : Read / Write) |