LibreOffice Module dbaccess (master) 1
Public Member Functions | Private Attributes | List of all members
dbaui::DynamicTableOrQueryNameCheck Class Reference

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>

Inheritance diagram for dbaui::DynamicTableOrQueryNameCheck:
[legend]
Collaboration diagram for dbaui::DynamicTableOrQueryNameCheck:
[legend]

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 DynamicTableOrQueryNameCheckoperator= (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DynamicTableOrQueryNameCheck() [1/2]

dbaui::DynamicTableOrQueryNameCheck::DynamicTableOrQueryNameCheck ( const css::uno::Reference< css::sdbc::XConnection > &  _rxSdbLevelConnection,
sal_Int32  _nCommandType 
)

constructs a DynamicTableOrQueryNameCheck instance

Parameters
_rxSdbLevelConnectiona connection supporting the css.sdb.Connection service, in other word, it does expose the XTablesSupplier and XQueriesSupplier interfaces.
_nCommandTypespecifies whether table names or query names should be checked. Only valid values are CommandType::TABLE and CommandType::QUERY.
Exceptions
css::lang::IllegalArgumentExceptionif the given connection is <NULL>, or the given command type is neither CommandType::TABLE nor CommandType::QUERY.

◆ ~DynamicTableOrQueryNameCheck()

dbaui::DynamicTableOrQueryNameCheck::~DynamicTableOrQueryNameCheck ( )
overridevirtual

Definition at line 121 of file defaultobjectnamecheck.cxx.

◆ DynamicTableOrQueryNameCheck() [2/2]

dbaui::DynamicTableOrQueryNameCheck::DynamicTableOrQueryNameCheck ( const DynamicTableOrQueryNameCheck )
delete

Member Function Documentation

◆ isNameValid()

bool dbaui::DynamicTableOrQueryNameCheck::isNameValid ( const OUString &  _rObjectName,
::dbtools::SQLExceptionInfo _out_rErrorToDisplay 
) const
overridevirtual

determines whether a given object name is valid

Parameters
_rObjectNamethe name to check
_out_rErrorToDisplayoutput parameter taking an error message describing why the name is not valid, if applicable.
Returns
<TRUE> if and only if the given name is valid.

Implements dbaui::IObjectNameCheck.

Definition at line 125 of file defaultobjectnamecheck.cxx.

References mnCommandType, and mxObjectNames.

Referenced by dbaui::OCopyTable::LeavePage(), and dbaui::OApplicationController::paste().

◆ operator=()

const DynamicTableOrQueryNameCheck & dbaui::DynamicTableOrQueryNameCheck::operator= ( const DynamicTableOrQueryNameCheck )
delete

Member Data Documentation

◆ mnCommandType

sal_Int32 dbaui::DynamicTableOrQueryNameCheck::mnCommandType
private

Definition at line 87 of file defaultobjectnamecheck.hxx.

Referenced by isNameValid().

◆ mxObjectNames

css::uno::Reference< css::sdb::tools::XObjectNames > dbaui::DynamicTableOrQueryNameCheck::mxObjectNames
private

Definition at line 88 of file defaultobjectnamecheck.hxx.

Referenced by isNameValid().


The documentation for this class was generated from the following files: