[fdo-commits] r671 -
branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Mon Jan 22 20:58:26 EST 2007
Author: mloskot
Date: 2007-01-22 20:58:25 -0500 (Mon, 22 Jan 2007)
New Revision: 671
Modified:
branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.cpp
branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.h
Log:
Prepared GdbiCommand to accept column name for get_gen_id() calls.
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.cpp
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.cpp 2007-01-23 01:53:58 UTC (rev 670)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.cpp 2007-01-23 01:58:25 UTC (rev 671)
@@ -408,21 +408,34 @@
// In case sequence is not supported this method simulate a sequence allocation scheme.
long GdbiCommands::NextRDBMSAutoincrementNumber( FdoString* adbSequenceName )
{
+ int number = 0;
+ bool seqSupported = true;
FdoStringP tableName;
- int number = 0;
- bool seqSupported = true;
+ FdoStringP columnName;
CheckDB();
// Get the table name from the sequence name.
if ( wcscmp( adbSequenceName, ADB_CLASSSEQW ) == 0 )
+ {
tableName = ADB_CLASSDEF_TABW;
+ columnName = ADB_CLASSDEF_AICOLW;
+ }
else if ( wcscmp( adbSequenceName, ADB_PLANSEQW ) == 0 )
- tableName = ADB_SPATIAL_CONTEXT_TABLEW;
+ {
+ tableName = ADB_SPATIAL_CONTEXT_TABW;
+ columnName = ADB_SPATIAL_CONTEXT_AICOLW;
+ }
else if ( wcscmp( adbSequenceName, ADB_PLANGROUPSEQW ) == 0 )
- tableName = ADB_SPATIAL_CONTEXT_GROUP_TABLEW;
+ {
+ tableName = ADB_SPATIAL_CONTEXT_GROUP_TABW;
+ columnName = ADB_SPATIAL_CONTEXT_GROUP_AICOLW;
+ }
else if ( wcscmp( adbSequenceName, ADB_FEATURESEQW ) == 0 )
+ {
tableName = L"";
+ columnName = L"";
+ }
else
seqSupported = false;
@@ -435,12 +448,12 @@
{
if (SupportsUnicode())
{
- if ( ::rdbi_get_gen_idW ( m_pRdbiContext, tableName, &number ) != RDBI_SUCCESS )
+ if ( ::rdbi_get_gen_idW ( m_pRdbiContext, tableName, columnName, &number ) != RDBI_SUCCESS )
ThrowException();
}
else
{
- if ( ::rdbi_get_gen_id ( m_pRdbiContext, tableName, &number ) != RDBI_SUCCESS )
+ if ( ::rdbi_get_gen_id ( m_pRdbiContext, tableName, columnName, &number ) != RDBI_SUCCESS )
ThrowException();
}
// Note: The number is the current generated one.
Modified: branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.h
===================================================================
--- branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.h 2007-01-23 01:53:58 UTC (rev 670)
+++ branches/fdordbms-postgis/Providers/GenericRdbms/Src/Gdbi/GdbiCommands.h 2007-01-23 01:58:25 UTC (rev 671)
@@ -85,9 +85,15 @@
#define ADB_USERSEQW L"F_USERSEQ"
#define ADB_CLASSDEF_TABW L"F_CLASSDEFINITION"
-#define ADB_SPATIAL_CONTEXT_TABLEW L"F_SPATIALCONTEXT"
-#define ADB_SPATIAL_CONTEXT_GROUP_TABLEW L"F_SPATIALCONTEXTGROUP"
+#define ADB_SPATIAL_CONTEXT_TABW L"F_SPATIALCONTEXT"
+#define ADB_SPATIAL_CONTEXT_GEOM_TABW L"F_SPATIALCONTEXTGEOM"
+#define ADB_SPATIAL_CONTEXT_GROUP_TABW L"F_SPATIALCONTEXTGROUP"
+#define ADB_CLASSDEF_AICOLW L"CLASSID"
+#define ADB_SPATIAL_CONTEXT_AICOLW L"SCID"
+#define ADB_SPATIAL_CONTEXT_GEOM_AICOLW L"SCID"
+#define ADB_SPATIAL_CONTEXT_GROUP_AICOLW L"SCGID"
+
#ifndef _WIN32
#define _stricmp strcasecmp
#endif
More information about the fdo-commits
mailing list