LibreOffice Module dbaccess (master) 1
|
class implementing the IObjectNameCheck interface, and checking a given name for being valid as either a query or a table name. More...
#include <defaultobjectnamecheck.hxx>
Public Member Functions | |
DynamicTableOrQueryNameCheck (const css::uno::Reference< css::sdbc::XConnection > &_rxSdbLevelConnection, sal_Int32 _nCommandType) | |
constructs a DynamicTableOrQueryNameCheck instance More... | |
virtual | ~DynamicTableOrQueryNameCheck () override |
DynamicTableOrQueryNameCheck (const DynamicTableOrQueryNameCheck &)=delete | |
const DynamicTableOrQueryNameCheck & | operator= (const DynamicTableOrQueryNameCheck &)=delete |
virtual bool | isNameValid (const OUString &_rObjectName, ::dbtools::SQLExceptionInfo &_out_rErrorToDisplay) const override |
determines whether a given object name is valid More... | |
Public Member Functions inherited from dbaui::IObjectNameCheck | |
virtual bool | isNameValid (const OUString &_rObjectName, ::dbtools::SQLExceptionInfo &_out_rErrorToDisplay) const =0 |
determines whether a given object name is valid More... | |
virtual | ~IObjectNameCheck () |
Private Attributes | |
sal_Int32 | mnCommandType |
css::uno::Reference< css::sdb::tools::XObjectNames > | mxObjectNames |
class implementing the IObjectNameCheck interface, and checking a given name for being valid as either a query or a table name.
The class can be parametrized to act as either table name or query name validator.
For databases which support queries in queries, the name check is implicitly extended to both queries and tables, no matter which category is checked. This prevents, for such databases, that users can create a query with the name of an existing table, or vice versa.
@seealso dbtools::DatabaseMetaData::supportsSubqueriesInFrom @seealso css::sdb::tools::XObjectNames::checkNameForCreate
Definition at line 84 of file defaultobjectnamecheck.hxx.
dbaui::DynamicTableOrQueryNameCheck::DynamicTableOrQueryNameCheck | ( | const css::uno::Reference< css::sdbc::XConnection > & | _rxSdbLevelConnection, |
sal_Int32 | _nCommandType | ||
) |
constructs a DynamicTableOrQueryNameCheck instance
_rxSdbLevelConnection | a connection supporting the css.sdb.Connection service, in other word, it does expose the XTablesSupplier and XQueriesSupplier interfaces. |
_nCommandType | specifies whether table names or query names should be checked. Only valid values are CommandType::TABLE and CommandType::QUERY. |
css::lang::IllegalArgumentException | if the given connection is <NULL>, or the given command type is neither CommandType::TABLE nor CommandType::QUERY. |
|
overridevirtual |
Definition at line 121 of file defaultobjectnamecheck.cxx.
|
delete |
|
overridevirtual |
determines whether a given object name is valid
_rObjectName | the name to check |
_out_rErrorToDisplay | output parameter taking an error message describing why the name is not valid, if applicable. |
Implements dbaui::IObjectNameCheck.
Definition at line 125 of file defaultobjectnamecheck.cxx.
References mnCommandType, and mxObjectNames.
Referenced by dbaui::OCopyTable::LeavePage(), and dbaui::OApplicationController::paste().
|
delete |
|
private |
Definition at line 87 of file defaultobjectnamecheck.hxx.
Referenced by isNameValid().
|
private |
Definition at line 88 of file defaultobjectnamecheck.hxx.
Referenced by isNameValid().