libgdamm Reference Documentation

Main Page Namespaces Book

# Gnome::Gda::QueryJoin Class Reference

This object is a join, within a SELECT query, between two different entities participating in the query; the entities are themselves represented by GdaQueryTarget objects. More...

Inheritance diagram for Gnome::Gda::QueryJoin:

[legend]
List of all members.

## Public Member Functions

Glib::RefPtr<const QueryCondition> | get_condition () const
| Get the join's associated condition.
Glib::RefPtr<QueryCondition> | get_condition ()
| Get the join's associated condition.
QueryJoinType | get_join_type () const
| Get the type of a join.
Glib::RefPtr<const Query> | get_query () const
| Get the Gda::Query to which join is attached to.
Glib::RefPtr<Query> | get_query ()
| Get the Gda::Query to which join is attached to.
Glib::RefPtr<const QueryTarget> | get_target_1 () const
| Get the 1st Gda::QueryTarget participating in the join.
Glib::RefPtr<QueryTarget> | get_target_1 ()
| Get the 1st Gda::QueryTarget participating in the join.
Glib::RefPtr<const QueryTarget> | get_target_2 () const
| Get the 2nd Gda::QueryTarget participating in the join.
Glib::RefPtr<QueryTarget> | get_target_2 ()
| Get the 2nd Gda::QueryTarget participating in the join.
const GdaQueryJoin* | gobj () const
| Provides access to the underlying C GObject.
GdaQueryJoin* | gobj ()
| Provides access to the underlying C GObject.
GdaQueryJoin* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Query >> | property_query () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<QueryTarget >> | property_target1 () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr< QueryTarget > > | property_target1 ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_WriteOnly< Glib::ustring > | property_target1_id ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<QueryTarget >> | property_target2 () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy< Glib::RefPtr< QueryTarget > > | property_target2 ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::PropertyProxy_WriteOnly< Glib::ustring > | property_target2_id ()
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
Glib::ustring | render_type () const
| Get the SQL version of the join type ("INNER JOIN", "LEFT JOIN", etc).
bool | set_condition (const Glib::RefPtr<QueryCondition>& cond)
| Sets cond to be join's condition.
bool | set_condition_from_fkcons ()
| Creates a Gda::QueryCondition for join using the foreign key constraints present in the database if the two targets join joins are database tables (Gda::DictTable objects).
bool | set_condition_from_sql (const Glib::ustring& cond)
| Parses cond and if it represents a valid SQL expression to be join's condition, then set it to be join's condition.
void | set_join_type (QueryJoinType type)
| Sets the type of join.
Glib::SignalProxy0<void> | signal_condition_changed ()

Prototype:
  `void on_my_condition_changed()`

Glib::SignalProxy0<void> | signal_type_changed ()

Prototype:
  `void on_my_type_changed()`

void | swap_targets ()
| Changes the relative roles of the two Gda::QueryTarget objects.
virtual | ~QueryJoin ()

## Static Public Member Functions

static Glib::RefPtr<QueryJoin> | create (const Glib::RefPtr<Query>& query, const Glib::ustring& target_1_xml_id, const Glib::ustring& target_2_xml_id)
static Glib::RefPtr<QueryJoin> | create (const Glib::RefPtr<Query>& query, const Glib::RefPtr<QueryTarget>& target_1, const Glib::RefPtr<QueryTarget>& target_2)

## Protected Member Functions

virtual void | on_condition_changed ()
virtual void | on_type_changed ()
| QueryJoin (const Glib::RefPtr<Query>& query, const Glib::ustring& target_1_xml_id, const Glib::ustring& target_2_xml_id)
| QueryJoin (const Glib::RefPtr<Query>& query, const Glib::RefPtr<QueryTarget>& target_1, const Glib::RefPtr<QueryTarget>& target_2)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr<Gnome::Gda::QueryJoin> | wrap (GdaQueryJoin* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

This object is a join, within a SELECT query, between two different entities participating in the query; the entities are themselves represented by GdaQueryTarget objects.

It is important to specify joining 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.

## Constructor & Destructor Documentation

virtual Gnome::Gda::QueryJoin::~QueryJoin | ( |  | ) | `[virtual]`

Gnome::Gda::QueryJoin::QueryJoin | ( | const Glib::RefPtr<Query>& | query,
|  | const Glib::RefPtr<QueryTarget>& | target_1,
|  | const Glib::RefPtr<QueryTarget>& | target_2 |
| ) |  |  | `[protected]`

Gnome::Gda::QueryJoin::QueryJoin | ( | const Glib::RefPtr<Query>& | query,
|  | const Glib::ustring & | target_1_xml_id,
|  | const Glib::ustring & | target_2_xml_id |
| ) |  |  | `[protected]`

## Member Function Documentation

static Glib::RefPtr<QueryJoin> Gnome::Gda::QueryJoin::create | ( | const Glib::RefPtr<Query>& | query,
|  | const Glib::ustring & | target_1_xml_id,
|  | const Glib::ustring & | target_2_xml_id |
| ) |  |  | `[static]`

static Glib::RefPtr<QueryJoin> Gnome::Gda::QueryJoin::create | ( | const Glib::RefPtr<Query>& | query,
|  | const Glib::RefPtr<QueryTarget>& | target_1,
|  | const Glib::RefPtr<QueryTarget>& | target_2 |
| ) |  |  | `[static]`

Glib::RefPtr<const QueryCondition> Gnome::Gda::QueryJoin::get_condition | ( |  | ) | const

Get the join's associated condition.

Returns:
  The Gda::QueryCondition object.

Glib::RefPtr<QueryCondition> Gnome::Gda::QueryJoin::get_condition | ( |  | ) |

Get the join's associated condition.

Returns:
  The Gda::QueryCondition object.

QueryJoinType Gnome::Gda::QueryJoin::get_join_type | ( |  | ) | const

Get the type of a join.

Returns:
  The type of join.

Glib::RefPtr<const Query> Gnome::Gda::QueryJoin::get_query | ( |  | ) | const

Get the Gda::Query to which join is attached to.

Returns:
  The Gda::Query.

Glib::RefPtr<Query> Gnome::Gda::QueryJoin::get_query | ( |  | ) |

Get the Gda::Query to which join is attached to.

Returns:
  The Gda::Query.

Glib::RefPtr<const QueryTarget> Gnome::Gda::QueryJoin::get_target_1 | ( |  | ) | const

Get the 1st Gda::QueryTarget participating in the join.

Returns:
  The Gda::QueryTarget.

Glib::RefPtr<QueryTarget> Gnome::Gda::QueryJoin::get_target_1 | ( |  | ) |

Get the 1st Gda::QueryTarget participating in the join.

Returns:
  The Gda::QueryTarget.

Glib::RefPtr<const QueryTarget> Gnome::Gda::QueryJoin::get_target_2 | ( |  | ) | const

Get the 2nd Gda::QueryTarget participating in the join.

Returns:
  The Gda::QueryTarget.

Glib::RefPtr<QueryTarget> Gnome::Gda::QueryJoin::get_target_2 | ( |  | ) |

Get the 2nd Gda::QueryTarget participating in the join.

Returns:
  The Gda::QueryTarget.

const GdaQueryJoin* Gnome::Gda::QueryJoin::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::QueryObject.

GdaQueryJoin* Gnome::Gda::QueryJoin::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::QueryObject.

GdaQueryJoin* Gnome::Gda::QueryJoin::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gnome::Gda::QueryObject.

virtual void Gnome::Gda::QueryJoin::on_condition_changed | ( |  | ) | `[protected, virtual]`

virtual void Gnome::Gda::QueryJoin::on_type_changed | ( |  | ) | `[protected, virtual]`

Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Query>> Gnome::Gda::QueryJoin::property_query | ( |  | ) | const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::RefPtr<QueryTarget>> Gnome::Gda::QueryJoin::property_target1 | ( |  | ) | const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::RefPtr<QueryTarget>> Gnome::Gda::QueryJoin::property_target1 | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_WriteOnly<Glib::ustring> Gnome::Gda::QueryJoin::property_target1_id | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::RefPtr<QueryTarget>> Gnome::Gda::QueryJoin::property_target2 | ( |  | ) | const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::RefPtr<QueryTarget>> Gnome::Gda::QueryJoin::property_target2 | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_WriteOnly<Glib::ustring> Gnome::Gda::QueryJoin::property_target2_id | ( |  | ) |

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::ustring Gnome::Gda::QueryJoin::render_type | ( |  | ) | const

Get the SQL version of the join type ("INNER JOIN", "LEFT JOIN", etc).

Returns:
  The type as a const string.

bool Gnome::Gda::QueryJoin::set_condition | ( | const Glib::RefPtr<QueryCondition>& | 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.

Parameters:

  | cond | A Gda::QueryCondition object, or `0` to remove the join's condition.

Returns:
  `true` if no error occurred.

bool Gnome::Gda::QueryJoin::set_condition_from_fkcons | ( |  | ) |

Creates a Gda::QueryCondition for join using the foreign key constraints present in the database if the two targets join joins are database tables (Gda::DictTable objects).

If there is more than one FK constraint between the database tables, then no join is created, and the call returns `false`.

Returns:
  `true` if suitable foreign keys were found and a join condition has been created.

bool Gnome::Gda::QueryJoin::set_condition_from_sql | ( | const Glib::ustring & | cond | ) |

Parses cond and if it represents a valid SQL expression to be join's condition, then set it to be join's condition.

Parameters:

  | cond | A SQL expression.

Returns:
  A `true` on success.

void Gnome::Gda::QueryJoin::set_join_type | ( | QueryJoinType | type | ) |

Sets the type of join.

Parameters:

  | type | The new type of join.

Glib::SignalProxy0< void > Gnome::Gda::QueryJoin::signal_condition_changed | ( |  | ) |

Prototype:
  `void on_my_condition_changed()`

Glib::SignalProxy0< void > Gnome::Gda::QueryJoin::signal_type_changed | ( |  | ) |

Prototype:
  `void on_my_type_changed()`

void Gnome::Gda::QueryJoin::swap_targets | ( |  | ) |

Changes the relative roles of the two Gda::QueryTarget objects.

It does not change the join condition itself, and is usefull only for the internals of the Gda::Query object

## Friends And Related Function Documentation

Glib::RefPtr<Gnome::Gda::QueryJoin> wrap | ( | GdaQueryJoin * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- queryjoin.h