Revision: 4912
http://sourceforge.net/p/jump-pilot/code/4912
Author: michaudm
Date: 2016-05-06 18:13:26 +0000 (Fri, 06 May 2016)
Log Message:
-----------
Manage some cases with several geometries in the table schema
Modified Paths:
--------------
core/trunk/src/org/openjump/core/ui/plugin/datastore/WritableDataStoreDataSource.java
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis2/PostGISDataStoreDataSource.java
Modified:
core/trunk/src/org/openjump/core/ui/plugin/datastore/WritableDataStoreDataSource.java
===================================================================
---
core/trunk/src/org/openjump/core/ui/plugin/datastore/WritableDataStoreDataSource.java
2016-05-02 15:42:04 UTC (rev 4911)
+++
core/trunk/src/org/openjump/core/ui/plugin/datastore/WritableDataStoreDataSource.java
2016-05-06 18:13:26 UTC (rev 4912)
@@ -401,6 +401,8 @@
// but always have dimension = 2. This use case does not
fit all !
int object_srid =
((Geometry)feature.getAttribute(i)).getSRID();
pstmt.setBytes(index++,
SQLUtil.getByteArrayFromGeometry((Geometry)feature.getAttribute(i),
object_srid, 2));
+ } else if (feature.getAttribute(i) instanceof String) {
+ pstmt.setBytes(index++,
feature.getAttribute(i).toString().getBytes());
}
else pstmt.setObject(index++, feature.getAttribute(i));
}
Modified:
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis2/PostGISDataStoreDataSource.java
===================================================================
---
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis2/PostGISDataStoreDataSource.java
2016-05-02 15:42:04 UTC (rev 4911)
+++
core/trunk/src/org/openjump/core/ui/plugin/datastore/postgis2/PostGISDataStoreDataSource.java
2016-05-06 18:13:26 UTC (rev 4912)
@@ -179,6 +179,8 @@
SQLUtil.normalize(schema.getAttributeName(schema.getGeometryIndex()))
:schema.getAttributeName(schema.getGeometryIndex());
try {
+ Logger.debug(conn.getMetadata()
+ .getCreateTableStatement(fc.getFeatureSchema(),
schemaName, tableName, normalizedColumnNames));
conn.getJdbcConnection().createStatement().execute(conn.getMetadata()
.getCreateTableStatement(fc.getFeatureSchema(),
schemaName, tableName, normalizedColumnNames));
} catch (SQLException sqle) {
@@ -186,6 +188,8 @@
.getCreateTableStatement(fc.getFeatureSchema(),
schemaName, tableName, normalizedColumnNames), sqle);
}
try {
+ Logger.debug(conn.getMetadata()
+ .getAddGeometryColumnStatement(schemaName, tableName,
geometryColumn, srid, geometryType, dim));
conn.getJdbcConnection().createStatement().execute(conn.getMetadata()
.getAddGeometryColumnStatement(schemaName, tableName,
geometryColumn, srid, geometryType, dim));
} catch (SQLException sqle) {
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel