Tag: cws_dev300_dba30c
User: oj      
Date: 2008-05-08 12:55:13+0000
Modified:
   dba/connectivity/source/commontools/TColumnsHelper.cxx
   dba/connectivity/source/commontools/TTableHelper.cxx
   dba/connectivity/source/commontools/dbtools2.cxx

Log:
 #i64472# use of create pattern

File Changes:

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: TColumnsHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TColumnsHelper.cxx?r1=1.10&r2=1.10.10.1
Delta lines:  +3 -3
-------------------
--- TColumnsHelper.cxx  2008-04-10 07:55:04+0000        1.10
+++ TColumnsHelper.cxx  2008-05-08 12:55:10+0000        1.10.10.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: TColumnsHelper.cxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.10.10.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -157,7 +157,7 @@
 
        aSql += ::dbtools::composeTableName( xMetaData, m_pTable, 
::dbtools::eInTableDefinitions, false, false, true );
        aSql += ::rtl::OUString::createFromAscii(" ADD ");
-       aSql += 
::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection());
+       aSql += 
::dbtools::createStandardColumnPart(descriptor,m_pTable->getConnection(),m_pTable->getTypeCreatePattern());
        
        Reference< XStatement > xStmt = 
m_pTable->getConnection()->createStatement(  );
        if ( xStmt.is() )

File [changed]: TTableHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TTableHelper.cxx?r1=1.9.10.3&r2=1.9.10.4
Delta lines:  +6 -1
-------------------
--- TTableHelper.cxx    2008-05-08 07:15:27+0000        1.9.10.3
+++ TTableHelper.cxx    2008-05-08 12:55:10+0000        1.9.10.4
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: TTableHelper.cxx,v $
- * $Revision: 1.9.10.3 $
+ * $Revision: 1.9.10.4 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -457,3 +457,8 @@
     m_aKeys.insert(TKeyMap::value_type(_sName,_aKeyProperties));
 }
 // 
-----------------------------------------------------------------------------
+::rtl::OUString OTableHelper::getTypeCreatePattern() const
+{
+    return ::rtl::OUString();
+}
+// 
-----------------------------------------------------------------------------
\ No newline at end of file

File [changed]: dbtools2.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbtools2.cxx?r1=1.27.10.1&r2=1.27.10.2
Delta lines:  +10 -10
---------------------
--- dbtools2.cxx        2008-05-06 11:43:09+0000        1.27.10.1
+++ dbtools2.cxx        2008-05-08 12:55:10+0000        1.27.10.2
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: dbtools2.cxx,v $
- * $Revision: 1.27.10.1 $
+ * $Revision: 1.27.10.2 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -74,7 +74,7 @@
        using namespace connectivity;
        using namespace comphelper;
 
-::rtl::OUString createStandardColumnPart(const Reference< XPropertySet >& 
xColProp,const Reference< XConnection>& _xConnection,bool _bAddScale)
+::rtl::OUString createStandardColumnPart(const Reference< XPropertySet >& 
xColProp,const Reference< XConnection>& _xConnection,const ::rtl::OUString& 
_sCreatePattern)
 {
 
        Reference<XDatabaseMetaData> xMetaData = _xConnection->getMetaData();
@@ -106,7 +106,7 @@
                
xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_AUTOINCREMENTCREATION))
 >>= sAutoIncrementValue;
        // look if we have to use precisions
        sal_Bool bUseLiteral = sal_False;
-       ::rtl::OUString sPreFix,sPostFix;
+       ::rtl::OUString sPreFix,sPostFix,sCreateParams;
        {
                Reference<XResultSet> xRes = xMetaData->getTypeInfo();
                if(xRes.is())
@@ -118,7 +118,7 @@
                                sal_Int32 nType = xRow->getShort(2);
                                sPreFix = xRow->getString (4);
                                sPostFix = xRow->getString (5);
-                               ::rtl::OUString sCreateParams = 
xRow->getString(6);
+                               sCreateParams = xRow->getString(6);
                                // first identical type will be used if 
typename is empty
                                if ( !sTypeName.getLength() && nType == 
nDataType )
                                        sTypeName = sTypeName2Cmp;
@@ -154,10 +154,10 @@
         if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP )
         {
                    aSql += ::rtl::OUString::valueOf(nPrecision);
-            if ( (nScale > 0) || _bAddScale )
+            if ( (nScale > 0) || (_sCreatePattern.getLength() && 
sCreateParams.indexOf(_sCreatePattern) != -1) )
                 aSql += ::rtl::OUString::createFromAscii(",");
         }
-               if ( (nScale > 0) || _bAddScale || nDataType == 
DataType::TIMESTAMP )
+               if ( (nScale > 0) || (_sCreatePattern.getLength() && 
sCreateParams.indexOf(_sCreatePattern) != -1 ) || nDataType == 
DataType::TIMESTAMP )
                        aSql += ::rtl::OUString::valueOf(nScale);
 
         if ( nParenPos == -1 )
@@ -188,7 +188,7 @@
 }
 // 
-----------------------------------------------------------------------------
 
-::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& 
descriptor,const Reference< XConnection>& _xConnection,bool _bAddScale)
+::rtl::OUString createStandardCreateStatement(const Reference< XPropertySet >& 
descriptor,const Reference< XConnection>& _xConnection,const ::rtl::OUString& 
_sCreatePattern)
 {
        ::rtl::OUString aSql    = ::rtl::OUString::createFromAscii("CREATE 
TABLE ");
        ::rtl::OUString sCatalog,sSchema,sTable,sComposedName;
@@ -220,7 +220,7 @@
        {
                if ( (xColumns->getByIndex(i) >>= xColProp) && xColProp.is() )
                {
-                       aSql += 
createStandardColumnPart(xColProp,_xConnection,_bAddScale);
+                       aSql += 
createStandardColumnPart(xColProp,_xConnection,_sCreatePattern);
                        aSql += ::rtl::OUString::createFromAscii(",");
                }
        }
@@ -361,9 +361,9 @@
 // 
-----------------------------------------------------------------------------
 ::rtl::OUString createSqlCreateTableStatement( const Reference< XPropertySet 
>& descriptor,
                                                                                
                const Reference< XConnection>& _xConnection,
-                                                bool _bAddScale)
+                                                const ::rtl::OUString& 
_sCreatePattern)
 {
-       ::rtl::OUString aSql = 
::dbtools::createStandardCreateStatement(descriptor,_xConnection,_bAddScale);
+       ::rtl::OUString aSql = 
::dbtools::createStandardCreateStatement(descriptor,_xConnection,_sCreatePattern);
        ::rtl::OUString sKeyStmt = 
::dbtools::createStandardKeyStatement(descriptor,_xConnection);
        if ( sKeyStmt.getLength() )
                aSql += sKeyStmt;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to