summaryrefslogtreecommitdiffstats
path: root/offapi/com/sun/star/sdb/tools/XTableName.idl
blob: 4a196c429f111730745ab5ce91eee547569632e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef __com_sun_star_sdb_tools_XTableName_idl__
#define __com_sun_star_sdb_tools_XTableName_idl__

#include <com/sun/star/lang/IllegalArgumentException.idl>
#include <com/sun/star/container/NoSuchElementException.idl>
#include <com/sun/star/beans/XPropertySet.idl>

module com {  module sun {  module star {  module sdb { module tools {

/** allows to manipulate table names.

    <p>When, in a database application, dealing with table names, there's many degrees
    of freedom to deal with. For instance, suppose you want to have the full name of a
    table object, as it should be used in a <code>SELECT</code> statement's <code>FROM</code>
    part. This requires you to evaluate whether or not the table has a catalog and/or schema
    name, to combine the catalog, the schema, and the basic table name into one name, respecting
    the database's quoting character, and the order in which all those parts should be combined.
    Additionally, you have to respect the client-side settings which tell OpenOffice.org
    to use or not use catalogs and schemas in <code>SELECT</code> at all.</p>

    <p>The XTableName interface eases this and other, similar tasks around table
    names.</p>

    <p>The component itself does not have life-time control mechanisms, i.e. you
    cannot explicitly dispose it (com::sun::star::lang::XComponent::dispose()),
    and you cannot be notified when it dies.<br/>
    However, if your try to access any of its methods or attributes, after the
    connection which was used to create it was closed, a com::sun::star::lang::DisposedException
    will be thrown.</p>

    @see XConnectionTools
    @see com::sun::star::sdbc::XDatabaseMetaData
    @see com::sun::star::sdb::DataSource::Settings

    @since OOo 2.0.4
*/
interface XTableName
{
    /** denotes the name of the catalog which the table is a part of
    */
    [attribute] string  CatalogName;

    /** denotes the name of the schema which the table is a part of
    */
    [attribute] string  SchemaName;

    /** denotes the mere, unqualified table name, excluding any catalog and
        schema.
    */
    [attribute] string  TableName;

    /** returns the composed table name, including the catalog and schema name,
        respecting the database's quoting requirements, plus

        @param Type
            the type of name composition to be used.

        @param Quote
            specifies whether the single parts of the table name should be quoted

        @see CompositionType

        @throws com::sun::star::IllegalArgumentException
            if the given Type does not denote a valid CompositionType
    */
    string  getComposedName( [in] long Type, [in] boolean Quote )
        raises ( com::sun::star::lang::IllegalArgumentException );


    /** sets a new composed table name
        @param ComposedName
            specifies the composed table name
        @param Type
            specifies the composition type which was used to create the composed table name
    */
    void    setComposedName( [in] string ComposedName, [in] long Type );

    /** represents the table name in a form to be used in a <code>SELECT</code> statement.

        <p>On a per-data-source basis, OpenOffice.org allows to override database meta
        data information in that you can specify to not use catalog and or schema names
        in <code>SELECT</code> statements. Using this attribute, you can generate a table
        name which respects those settings.</p>

        @see com::sun::star::sdb::DataSource::Settings
    */
    [attribute, readonly]   string  NameForSelect;

    /** is the com::sun::star::sdb::Table object specified
        by the current name.

        <p>Retrieving this attribute is equivalent to obtaining the tables
        container from the connection (via com::sun::star::sdbcx::XTablesSupplier),
        and calling its com::sun::star::container::XNameAccess::getByName()
        method with the ComposedName.</p>

        @throws com::sun::star::container::NoSuchElementException
            if, upon getting the attribute value, the current composed table name
            represented by this instance does not denote an existing table in the database.
        @throws com::sun::star::lang::IllegalArgumentException
            if you try to set an object which does not denote a table from the underlying
            database.
    */
    [attribute] ::com::sun::star::beans::XPropertySet    Table
    {
        get raises ( com::sun::star::container::NoSuchElementException );
        set raises ( com::sun::star::lang::IllegalArgumentException );
    };
};

}; }; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */