diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-21 14:15:23 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-21 14:15:23 +0000 |
commit | 23022c73372a0e0b9286b91b802cb1a606bd3995 (patch) | |
tree | d77010493a645c002cb2ee791f56ce0df656b0b8 /offapi/com/sun/star/sdb/ErrorCondition.idl | |
parent | 2c5943bcf54548bcb136a783d3a29d64c236c1e6 (diff) |
INTEGRATION: CWS dba24c (1.1.2); FILE ADDED
2007/09/20 18:36:20 fs 1.1.2.3: #i80856# new error conditions
2007/09/18 20:12:42 fs 1.1.2.2: +PARSER_CYCLIC_SUB_QUERIES
2007/09/18 13:15:01 fs 1.1.2.1: #i81095# defined ErrorCodes for the vendor 'OOoBase'
Diffstat (limited to 'offapi/com/sun/star/sdb/ErrorCondition.idl')
-rw-r--r-- | offapi/com/sun/star/sdb/ErrorCondition.idl | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/offapi/com/sun/star/sdb/ErrorCondition.idl b/offapi/com/sun/star/sdb/ErrorCondition.idl new file mode 100644 index 000000000000..f438d5e2ab5d --- /dev/null +++ b/offapi/com/sun/star/sdb/ErrorCondition.idl @@ -0,0 +1,152 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ErrorCondition.idl,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: ihi $ $Date: 2007-11-21 15:15:23 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_ErrorCondition_idl__ +#define __com_sun_star_sdb_ErrorCondition_idl__ + +//============================================================================= + +module com { module sun { module star { module sdb { + +//============================================================================= + +/** defines error conditions for OpenOffice.org Base core components + + <p>Core components of OpenOffice.org will use those error conditions + as error codes (<member scope="com::sun::star::sdbc">SQLException::ErrorCode</member>) + whereever possible.<br/> + That is, if an <code>SQLException</code> is raised by + such a component, caused by an error condition which is included in the + <type>ErrorCondition</type> group, then the respective <em>negative</em> value + will be used as <code>ErrorCode</code>.</p> + + <p>This allows to determine specific error conditions in your client code, and + to handle it appropriately.</p> + + <p>Note that before you examine the <code>ErrorCode</code> member of a caught + <code>SQLException</code>, you need to make sure that the exception + is really thrown by an OpenOffice.org Base core component. To do so, check + whether the error message (<code>Exception::Message</code>) starts with the + vendor string <code>[OOoBase]</code>.</p> + + <p>The list of defined error conditions, by nature, is expected to permanently grow, + so never assume it being finalized.</p> + + @example Java + <listing> + catch ( SQLException e ) + { + if ( e.Message.startsWith( "[OOoBase]" ) ) + if ( e.ErrorCode + ErrorCondition.SOME_ERROR_CONDITION == 0 ) + handleSomeErrorCondition(); + } + </listing> + */ +constants ErrorCondition +{ + // ======================================================================== + // = section ROW_SET - css.sdb.RowSet related error conditions + + /** is used by and <type>RowSet</type> to indicate that an operation has been vetoed + by one of its approval listeners + + <p>This error condition results in raising a <type>RowSetVetoException</type>.</p> + @see RowSet + @see XRowSetApproveBroadcaster + @see XRowSetApproveListener + */ + const long ROW_SET_OPERATION_VETOED = 100; + + // ======================================================================== + // = section PARSER - parsing related error conditions + + /** indicates that while parsing an SQL statement, cyclic sub queries have been detected. + + <p>Imagine you have a client-side query <code>SELECT * FROM table</code>, which is + saved as "query1". Additionally, there is a query "query2" defined + as <code>SELECT * FROM query1</code>. Now if you try to change the statement of + <type>query1</type> to <code>SELECT * FROM query2</code>, this is prohibited, because + it would lead to a cyclic sub query. + */ + const long PARSER_CYCLIC_SUB_QUERIES = 200; + + // ======================================================================== + // = section DB - application-level error conditions + // = + // = next section should start with 500 + + /** indicates that the name of a client side database object - a query, a form, + or a report - contains one or more slashes, which is forbidden. + */ + const long DB_OBJECT_NAME_WITH_SLASHES = 300; + + /** indicates that an identifier is not SQL conform. + */ + const long DB_INVALID_SQL_NAME = 301; + + /** indicates that the name of a query contains quote characters. + + <p>This error condition is met when the user attempts to save a query + with a name which contains one of the possible database quote characters. + This is an error since query names can potentially be used in + <code>SELECT</code> statements, where quote identifiers would render the statement invalid.</p> + + @see com::sun::star::sdb::tools::XDataSourceMetaData::supportsQueriesInFrom + */ + const long DB_QUERY_NAME_WITH_QUOTES = 302; + + /** indicates that an attempt was made to save a database object under a name + which is already used in the database. + + <p>In databases which support query names to appear in <code>SELECT</code> + statements, this could mean that a query was attempted to be saved with the + name of an existing query, or vice versa.</p> + + <p>Otherwise, it means an object was attempted to be saved with the + name of an already existing object of the same type.</p> + + @see com::sun::star::sdb::application::DatabaseObject + @see com::sun::star::sdb::tools::XDataSourceMetaData::supportsQueriesInFrom + */ + const long DB_OBJECT_NAME_IS_USED = 303; +}; + +//============================================================================= + +}; }; }; }; + +//============================================================================= + +#endif |