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