1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_sdbc_XSQLData_idl__
20 #define __com_sun_star_sdbc_XSQLData_idl__
22 #include
<com
/sun
/star
/uno
/XInterface.idl
>
24 #include
<com
/sun
/star
/sdbc
/SQLException.idl
>
26 module com
{ module sun
{ module star
{ module sdbc
{
28 published
interface XSQLInput
;
29 published
interface XSQLOutput
;
32 /** is used for the custom mapping of SQL user-defined types.
36 This interface must be implemented by a service that is
37 registered in a type mapping. It is expected that this interface
38 will normally be implemented by a tool. The methods in this interface
39 are called by the driver and are never called by a programmer
43 published
interface XSQLData
: com
::sun
::star
::uno
::XInterface
46 /** returns the fully-qualified name of the SQL user-defined type
47 that this object represents.
51 This method is called by the SDBC driver to get the name of the
52 UDT instance that is being mapped to this instance of SQLData.
55 the name of the SQL type.
57 if a database access error occurs.
59 string getSQLTypeName
() raises
(SQLException
);
62 /** populates this object with data read from the database.
66 The implementation of the method must follow this protocol:
68 It must read each of the attributes or elements of the SQL
69 type from the given input stream. This is done
70 by calling a method of the input stream to read each
71 item, in the order that they appear in the SQL definition
72 of the type. The method
74 then assigns the data to appropriate fields or elements (of this
77 Specifically, it must call the appropriate
78 <code>XSQLInput.readXXX</code>
79 method(s) to do the following:
80 for a Distinct Type, read its single data element;
81 for a Structured Type, read a value for each attribute of the SQL type.
84 The SDBC driver initializes the input stream with a type map
85 before calling this method, which is used by the appropriate
86 <code>SQLInput.readXXX</code>
91 the input SQL data stream
93 the SQL type of the value on the data stream
95 if a database access error occurs.
97 @see com::sun::star::sdbc::XSQLInput
99 void readSQL
([in]XSQLInput stream
, [in]string typeName
)
100 raises
(SQLException
);
102 /** writes this object to the given SQL data stream.
106 The implementation of the method must follow this protocol:
108 It must write each of the attributes of the SQL type to the given output
109 stream. This is done by calling a method of the output stream to write
110 each item, in the order that they appear in the SQL definition of the type.
111 Specifically, it must call the appropriate
112 <code>XSQLOutput.writeXXX</code>
113 method(s) to do the following:<br>
114 for a Distinct Type, write its single data element;
115 for a Structured Type, write a value for each attribute of the SQL type.
118 the output SQL data stream
120 if a database access error occurs.
121 @see com::sun::star::sdbc::XSQLOutput
123 void writeSQL
([in]XSQLOutput stream
) raises
(SQLException
);
129 /*===========================================================================
130 ===========================================================================*/
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */