Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > fc480f9d5aabed8eeaffe8ad3401a94c > files > 5354

openoffice.org-devel-doc-3.2.1-0.3mdv2010.2.i586.rpm

<html>
<head>
<title>Interface XObjectNames</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../idl.css">
</head>
<body>
<div id="adc-idlref">

<a name="_top_"> </a><table class="navimain" border="0" cellpadding="3">
<tr>
<td class="navimain"><a href="../../module-ix.html" class="navimain">Overview</a></td>
<td class="navimain"><a href="module-ix.html" class="navimain">Module</a></td>
<td class="navimain"><a href="XObjectNames-xref.html" class="navimain">Use</a></td>
<td class="navimainnone">Devguide</td>
<td class="navimain"><a href="../../../../../index-files/index-1.html" class="navimain">Index</a></td>
</tr>
</table>
<table class="navisub" border="0" cellpadding="0">
<tr>
<td class="navisub"><a href="#MethodsSummary" class="navisub">Methods' Summary</a></td>
<td class="navisub">Attributes' Summary</td>
<td class="navisub"><a href="#MethodsDetails" class="navisub">Methods' Details</a></td>
<td class="navisub">Attributes' Details</td>
</tr>
</table>
<hr>
<table border="0" width="100%" cellpadding="5" cellspacing="3" class="title-table" style="margin-bottom:6pt;">
<tr>
<td><p class="namechain"><a href="../../../../../module-ix.html" class="namechain">::</a> <a href="../../../../module-ix.html" class="namechain">com</a> :: <a href="../../../module-ix.html" class="namechain">sun</a> :: <a href="../../module-ix.html" class="namechain">star</a> :: <a href="../module-ix.html" class="namechain">sdb</a> :: <a href="module-ix.html" class="namechain">tools</a> :: </p>
</td>
</tr>
<tr>
<td class="title"><table class="title-table" width="99%">
<tr>
<td width="25%" class="title2">unpublished </td>
<td width="50%" class="title">interface XObjectNames</td>
<td width="*"/></tr>
</table>
</td>
</tr>
<tr>
<td/></tr>
<tr>
<td><dl>
<dt><b>Usage Restrictions</b></dt>
<dd><i>not published</i></dd>
<dt><b>Description</b></dt>
<dd>encapsulates functionality which you might find useful when writing a
 database application which deals with query and table names.

 </dd>
<dd><p>The most important task fulfilled by this instance is that it hides
 different naming restrictions from you, which are caused by server-side
 or client side specialities.</p>

 <p>For instance, it can validate names against
 the characters allowed in the object names of a connection. Also, it
 relieves you from caring whether a database supports queries in a <code>SELECT</code>
 statment's <code>FROM</code> part (known as "queries in queries"). In such
 databases, query and table names share a common namespace, thus they must be
 unique. Using this interface, you can easily ensure this uniqueness.</p>

 <p>All of the functionality present in this interface depends on a connection,
 thus it entry point for obtaining it is a ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../Connection.html">Connection</a>
 service.</p>

 <p>The component itself does not have life-time control mechanimns, i.e. you
 cannot explicitly dispose it (::com::sun::star::<a href="../../lang/module-ix.html">lang</a>::<a href="../../lang/XComponent.html">XComponent</a>::<a href="../../lang/XComponent.html#dispose">dispose</a>),
 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::<a href="../../lang/module-ix.html">lang</a>::<a href="../../lang/DisposedException.html">DisposedException</a>
 will be thrown.</p>

 </dd>
<dt><b>Since </b></dt>
<dd>OpenOffice 2.0.4</dd>
<dt><b>See also</b></dt>
<dd><a href="XConnectionTools.html">XConnectionTools</a></dd>
</dl>
</td>
</tr>
</table>
<hr>
<a name="MethodsSummary"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle">
<tr>
<td class="subtitle" colspan="2">Methods' Summary</td>
</tr>
<tr>
<td class="imsum_left"><a href="#suggestName">suggestName</a></td>
<td class="imsum_right">suggests a (unique) table or query name

 &nbsp;</td>
</tr>
<tr>
<td class="imsum_left"><a href="#convertToSQLName">convertToSQLName</a></td>
<td class="imsum_right">converts the given object name to a name which is valid in the database.

 &nbsp;</td>
</tr>
<tr>
<td class="imsum_left"><a href="#isNameUsed">isNameUsed</a></td>
<td class="imsum_right">checks whether a given name is used as table respectively query name in the database.

 &nbsp;</td>
</tr>
<tr>
<td class="imsum_left"><a href="#isNameValid">isNameValid</a></td>
<td class="imsum_right">checks whether a given name is valid as table or query name

 &nbsp;</td>
</tr>
<tr>
<td class="imsum_left"><a href="#checkNameForCreate">checkNameForCreate</a></td>
<td class="imsum_right">checks whether a given name is allowed for a to-be-created table or query in the
 database.

 &nbsp;</td>
</tr>
</table>
<a name="MethodsDetails"/><table border="1" width="100%" cellpadding="5" cellspacing="0" class="subtitle">
<tr>
<td class="subtitle">Methods' Details</td>
</tr>
<tr>
<td class="imdetail"><a name="suggestName" class="membertitle">suggestName</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center">
<tr>
<td><table class="table-in-method" border="0">
<tr>
<td valign="top" colspan="3">string</td>
</tr>
<tr>
<td valign="top"><b>suggestName</b>(</td>
<td valign="top">[in] long</td>
<td valign="bottom">&nbsp;CommandType,</td>
</tr>
<tr>
<td/><td valign="top">[in] string</td>
<td valign="bottom">&nbsp;BaseName )</td>
</tr>
<tr>
<td valign="top" align="right">raises( </td>
<td valign="top" colspan="2">::com::sun::star::<a href="../../lang/module-ix.html">lang</a>::<a href="../../lang/IllegalArgumentException.html">IllegalArgumentException</a> );</td>
</tr>
</table>
<hr>
<dl>
<dt><b>Description</b></dt>
<dd>suggests a (unique) table or query name

 </dd>
<dd><p>If in the database, tables and queries share a common namespace, this will be respected
 by this function.</p>

 <p>Note that in an multi-threaded environment, the name you obtain here is not absolutely
 guaranteed to be unique. It is unique at the very moment the function returns to you.
 But already when you evaluate the returned value, it might not be uniquey anymore, if
 another process or thread created a query or table with this name.</p>

 <p>This implies that you cannot rely on the name's uniqueness, but you can use it as
 first guess to present to the user. In most cases, it will still be sufficient when
 you are actually creating the table respectively query.</p>

 </dd>
<dt><b>Parameter CommandType</b></dt>
<dd>specifies the ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../CommandType.html">CommandType</a> of the object for which
 a unique name is to be generated. Must be either ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../CommandType.html">CommandType</a>::<a href="../CommandType.html#TABLE">TABLE</a>
 or ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../CommandType.html">CommandType</a>::<a href="../CommandType.html#QUERY">QUERY</a>.

 </dd>
<dt><b>Parameter BaseName</b></dt>
<dd>specifies the base of the to-be-created object name. If empty, a default
 base name will be used.

 </dd>
<dt><b>Throws</b></dt>
<dd>com::sun::star::lang::IllegalArgumentException
 if <arg>CommandType</arg> specifies an invalid command type.
 </dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="convertToSQLName" class="membertitle">convertToSQLName</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center">
<tr>
<td><table class="table-in-method" border="0">
<tr>
<td valign="top" colspan="3">string</td>
</tr>
<tr>
<td valign="top"><b>convertToSQLName</b>(</td>
<td valign="top">[in] string</td>
<td valign="bottom">&nbsp;Name );</td>
</tr>
</table>
<hr>
<dl>
<dt><b>Description</b></dt>
<dd>converts the given object name to a name which is valid in the database.

 </dd>
<dd><p>The conversion takes place by converting every character which is neither
 allowed by the SQL-92 standard, nor part of the special characters supported
 by the database, with an underscore character (_).</p>

 </dd>
<dt><b>See also</b></dt>
<dd>::com::sun::star::<a href="../../sdbc/module-ix.html">sdbc</a>::<a href="../../sdbc/XDatabaseMetaData.html">XDatabaseMetaData</a>::<a href="../../sdbc/XDatabaseMetaData.html#getExtraNameCharacters">getExtraNameCharacters</a></dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="isNameUsed" class="membertitle">isNameUsed</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center">
<tr>
<td><table class="table-in-method" border="0">
<tr>
<td valign="top" colspan="3">boolean</td>
</tr>
<tr>
<td valign="top"><b>isNameUsed</b>(</td>
<td valign="top">[in] long</td>
<td valign="bottom">&nbsp;CommandType,</td>
</tr>
<tr>
<td/><td valign="top">[in] string</td>
<td valign="bottom">&nbsp;Name )</td>
</tr>
<tr>
<td valign="top" align="right">raises( </td>
<td valign="top" colspan="2">::com::sun::star::<a href="../../lang/module-ix.html">lang</a>::<a href="../../lang/IllegalArgumentException.html">IllegalArgumentException</a> );</td>
</tr>
</table>
<hr>
<dl>
<dt><b>Description</b></dt>
<dd>checks whether a given name is used as table respectively query name in the database.

 </dd>
<dd><p>If in the database, tables and queries share a common namespace, this will be respected
 by this function.</p>

 <p>As before, the information you obtain by calling this method might be obsolete
 in the very moment you evaluate this, in case another process or thread interferes.
 However, it's usually sufficiently up-to-date for purpose of using it in a database
 application driven by user interactions.</p>

 </dd>
<dt><b>Parameter CommandType</b></dt>
<dd>specifies the ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../CommandType.html">CommandType</a> of the object whose
 name should be checked. Must be either ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../CommandType.html">CommandType</a>::<a href="../CommandType.html#TABLE">TABLE</a>
 or ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../CommandType.html">CommandType</a>::<a href="../CommandType.html#QUERY">QUERY</a>.

 </dd>
<dt><b>Parameter Name</b></dt>
<dd>specifies the to-be-checked name of the object.

 </dd>
<dt><b>Returns</b></dt>
<dd><b>true</b> if and only if the given name is legitimate as table respectively query name
 to be used in the database.

 </dd>
<dt><b>Throws</b></dt>
<dd>com::sun::star::lang::IllegalArgumentException
 if <arg>CommandType</arg> specifies an invalid command type.

 </dd>
<dt><b>See also</b></dt>
<dd><a href="#checkNameIsUsed">checkNameIsUsed</a></dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="isNameValid" class="membertitle">isNameValid</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center">
<tr>
<td><table class="table-in-method" border="0">
<tr>
<td valign="top" colspan="3">boolean</td>
</tr>
<tr>
<td valign="top"><b>isNameValid</b>(</td>
<td valign="top">[in] long</td>
<td valign="bottom">&nbsp;CommandType,</td>
</tr>
<tr>
<td/><td valign="top">[in] string</td>
<td valign="bottom">&nbsp;Name )</td>
</tr>
<tr>
<td valign="top" align="right">raises( </td>
<td valign="top" colspan="2">::com::sun::star::<a href="../../lang/module-ix.html">lang</a>::<a href="../../lang/IllegalArgumentException.html">IllegalArgumentException</a> );</td>
</tr>
</table>
<hr>
<dl>
<dt><b>Description</b></dt>
<dd>checks whether a given name is valid as table or query name

 </dd>
<dd><p>For tables, the name must consist of characters allowed by the SQL-92 standard,
 plus characters allowed by the connection as extra name characters.</p>

 <p>For queries, names are nearly arbitrary, except that usual quoting characters
 must not be part of the name.</p>

 </dd>
<dt><b>See also</b></dt>
<dd>::com::sun::star::<a href="../../sdbc/module-ix.html">sdbc</a>::<a href="../../sdbc/XDatabaseMetaData.html">XDatabaseMetaData</a>::<a href="../../sdbc/XDatabaseMetaData.html#getExtraNameCharacters">getExtraNameCharacters</a></dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="imdetail"><a name="checkNameForCreate" class="membertitle">checkNameForCreate</a><table border="0" width="96%" cellpadding="5" cellspacing="0" class="table-in-method" bgcolor="#ffffff" align="center">
<tr>
<td><table class="table-in-method" border="0">
<tr>
<td valign="top" colspan="3">void</td>
</tr>
<tr>
<td valign="top"><b>checkNameForCreate</b>(</td>
<td valign="top">[in] long</td>
<td valign="bottom">&nbsp;CommandType,</td>
</tr>
<tr>
<td/><td valign="top">[in] string</td>
<td valign="bottom">&nbsp;Name )</td>
</tr>
<tr>
<td valign="top" align="right">raises( </td>
<td valign="top" colspan="2">::com::sun::star::<a href="../../sdbc/module-ix.html">sdbc</a>::<a href="../../sdbc/SQLException.html">SQLException</a> );</td>
</tr>
</table>
<hr>
<dl>
<dt><b>Description</b></dt>
<dd>checks whether a given name is allowed for a to-be-created table or query in the
 database.

 </dd>
<dd><p>This method basically does the same checks as <a href="#isNameUsed">isNameUsed</a> and
 <a href="#isNameValid">isNameValid</a>. In case the given name is not allowed, it throws an
 exception. This error can be presented to the user, to give it a common experience
 in all cases where he's required to enter an object name.</p>

 </dd>
<dt><b>See also</b></dt>
<dd><a href="#isNameUsed">isNameUsed</a>, <a href="#isNameValid">isNameValid</a>, ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../ErrorMessageDialog.html">ErrorMessageDialog</a>, ::com::sun::star::<a href="../module-ix.html">sdb</a>::<a href="../InteractionHandler.html">InteractionHandler</a></dd>
</dl>
</td>
</tr>
</table>
</td>
</tr>
</table>
<a href="#_top_">Top of Page</a><hr size="3"><p class="copyright" align="center">Copyright &copy; 2011, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.</p>

</div> <!-- id="adc-idlref" -->
</body>

</html>