20#include <core_resource.hxx>
25#include <com/sun/star/lang/IllegalArgumentException.hpp>
26#include <com/sun/star/sdb/CommandType.hpp>
27#include <com/sun/star/sdbc/SQLException.hpp>
32#include <rtl/ustrbuf.hxx>
43 using ::com::sun::star::uno::Reference;
44 using ::com::sun::star::lang::IllegalArgumentException;
45 using ::com::sun::star::container::XHierarchicalNameAccess;
46 using ::com::sun::star::sdbc::SQLException;
47 using ::com::sun::star::uno::Exception;
48 using ::com::sun::star::sdbc::XConnection;
49 using ::com::sun::star::sdb::tools::XConnectionTools;
50 using ::com::sun::star::uno::UNO_QUERY;
54 namespace CommandType = ::com::sun::star::sdb::CommandType;
59 void lcl_fillNameExistsError( std::u16string_view _rObjectName,
SQLExceptionInfo& _out_rErrorToDisplay )
62 OUString sErrorMessage =
DBA_RES(STR_NAMED_OBJECT_ALREADY_EXISTS);
63 aError.Message = sErrorMessage.replaceAll(
"$#$", _rObjectName);
64 _out_rErrorToDisplay = aError;
76 throw IllegalArgumentException();
87 OUStringBuffer aCompleteName;
92 aCompleteName.append( _rObjectName );
94 OUString sCompleteName( aCompleteName.makeStringAndClear() );
103 lcl_fillNameExistsError( _rObjectName, _out_rErrorToDisplay );
111 if ( xConnTools.is() )
114 throw IllegalArgumentException();
117 throw IllegalArgumentException();
132 catch(
const SQLException& )
virtual ~DynamicTableOrQueryNameCheck() override
virtual bool isNameValid(const OUString &_rObjectName, ::dbtools::SQLExceptionInfo &_out_rErrorToDisplay) const override
determines whether a given object name is valid
css::uno::Reference< css::sdb::tools::XObjectNames > mxObjectNames
DynamicTableOrQueryNameCheck(const css::uno::Reference< css::sdbc::XConnection > &_rxSdbLevelConnection, sal_Int32 _nCommandType)
constructs a DynamicTableOrQueryNameCheck instance
virtual ~HierarchicalNameCheck() override
virtual bool isNameValid(const OUString &_rObjectName, ::dbtools::SQLExceptionInfo &_out_rErrorToDisplay) const override
determines whether a given object name is valid
css::uno::Reference< css::container::XHierarchicalNameAccess > mxHierarchicalNames
HierarchicalNameCheck(const css::uno::Reference< css::container::XHierarchicalNameAccess > &_rxNames, const OUString &_rRelativeRoot)
constructs a HierarchicalNameCheck instance
#define DBG_UNHANDLED_EXCEPTION(...)