Update ooo320-m1
[ooovba.git] / offapi / com / sun / star / sdbc / XSQLData.idl
blob39f82b8f6aae8397e1fee9c460fadce375f96fe2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XSQLData.idl,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_sdbc_XSQLData_idl__
31 #define __com_sun_star_sdbc_XSQLData_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include <com/sun/star/uno/XInterface.idl>
35 #endif
37 #ifndef __com_sun_star_sdbc_SQLException_idl__
38 #include <com/sun/star/sdbc/SQLException.idl>
39 #endif
41 module com { module sun { module star { module sdbc {
43 published interface XSQLInput;
44 published interface XSQLOutput;
47 /** is used for the custom mapping of SQL user-defined types.
50 <p>
51 This interface must be implemented by a service that is
52 registered in a type mapping. It is expected that this interface
53 will normally be implemented by a tool. The methods in this interface
54 are called by the driver and are never called by a programmer
55 directly.
56 </p>
58 published interface XSQLData: com::sun::star::uno::XInterface
61 /** returns the fully-qualified name of the SQL user-defined type
62 that this object represents.
65 <p>
66 This method is called by the SDBC driver to get the name of the
67 UDT instance that is being mapped to this instance of SQLData.
68 </p>
69 @returns
70 the name of the SQL type.
71 @throws SQLException
72 if a database access error occurs.
74 string getSQLTypeName() raises (SQLException);
76 //-------------------------------------------------------------------------
78 /** populates this object with data read from the database.
81 <p>
82 The implementation of the method must follow this protocol:
83 <br/>
84 It must read each of the attributes or elements of the SQL
85 type from the given input stream. This is done
86 by calling a method of the input stream to read each
87 item, in the order that they appear in the SQL definition
88 of the type. The method
89 <code>readSQL</code>
90 then assigns the data to appropriate fields or elements (of this
91 or other objects).
92 <br/>
93 Specifically, it must call the appropriate
94 <code>XSQLInput.readXXX</code>
95 method(s) to do the following:
96 for a Distinct Type, read its single data element;
97 for a Structured Type, read a value for each attribute of the SQL type.
98 </p>
99 <p>
100 The SDBC driver initializes the input stream with a type map
101 before calling this method, which is used by the appropriate
102 <code>SQLInput.readXXX</code>
103 method on the stream.
104 </p>
106 @param stream
107 the input SQL data stream
108 @param typeName
109 the SQL type of the value on the data stream
110 @throws SQLException
111 if a database access error occurs.
113 @see com::sun::star::sdbc::XSQLInput
115 void readSQL([in]XSQLInput stream, [in]string typeName)
116 raises (SQLException);
117 //-------------------------------------------------------------------------
119 /** writes this object to the given SQL data stream.
123 The implementation of the method must follow this protocol:
124 <br/>
125 It must write each of the attributes of the SQL type to the given output
126 stream. This is done by calling a method of the output stream to write
127 each item, in the order that they appear in the SQL definition of the type.
128 Specifically, it must call the appropriate
129 <code>XSQLOutput.writeXXX</code>
130 method(s) to do the following:<br>
131 for a Distinct Type, write its single data element;
132 for a Structured Type, write a value for each attribute of the SQL type.
133 </p>
134 @param stream
135 the output SQL data stream
136 @throws SQLException
137 if a database access error occurs.
138 @see com::sun::star::sdbc::XSQLOutput
140 void writeSQL([in]XSQLOutput stream) raises (SQLException);
143 //=============================================================================
145 }; }; }; };
147 /*===========================================================================
148 ===========================================================================*/
149 #endif