Class H2DataStoreDataSource
- java.lang.Object
-
- com.vividsolutions.jump.io.datasource.DataSource
-
- com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreQueryDataSource
-
- com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreDataSource
-
- org.openjump.core.ui.plugin.datastore.WritableDataStoreDataSource
-
- org.openjump.core.ui.plugin.datastore.h2.H2DataStoreDataSource
-
- All Implemented Interfaces:
WorkbenchContextReference
public class H2DataStoreDataSource extends WritableDataStoreDataSource
AWritableDataStoreDataSourcefor H2.
-
-
Field Summary
-
Fields inherited from class org.openjump.core.ui.plugin.datastore.WritableDataStoreDataSource
CONVERT_TO_MULTIGEOMETRY_KEY, CREATE_PK, DEFAULT_PK_NAME, evolutions, EXTERNAL_PK_KEY, GEOM_DIM_KEY, LIMITED_TO_VIEW, MANAGE_CONFLICTS, NAN_Z_TO_VALUE_KEY, NARROW_GEOMETRY_TYPE_KEY, NORMALIZED_COLUMN_NAMES, primaryKeyName, schemaName, SRID_KEY, tableName, TX_MANAGER_KEY
-
Fields inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreDataSource
CACHING_KEY, context, DATASET_NAME_KEY, GEOMETRY_ATTRIBUTE_NAME_KEY, MAX_FEATURES_KEY, WHERE_CLAUSE_KEY
-
Fields inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreQueryDataSource
CONNECTION_DESCRIPTOR_KEY, PATTERN_FENCE, PATTERN_SELECTION, PATTERN_VIEW, PRIMARY_KEY_KEY, SQL_QUERY_KEY
-
Fields inherited from class com.vividsolutions.jump.io.datasource.DataSource
CHARSET_KEY, COMPRESSED_KEY, COORDINATE_SYSTEM_CODE, COORDINATE_SYSTEM_KEY, COORDINATE_SYSTEM_REGISTRY, FILE_KEY, URI_KEY
-
-
Constructor Summary
Constructors Constructor Description H2DataStoreDataSource()H2DataStoreDataSource(ConnectionDescriptor connectionDescriptor, String datasetName, String geometryAttributeName, String identifierAttributeName, String txManagerClass, WorkbenchContext context)H2DataStoreDataSource(WorkbenchContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDBPrimaryKey(SpatialDatabasesDSConnection conn, String primaryKey)Add an automatically named primary key constraint to the table.protected voidcreateAndPopulateTable(SpatialDatabasesDSConnection conn, FeatureCollection fc, int srid, String geometryType, boolean multi, int dim, boolean normalizedColumnNames)Create and populate a table with features from a dataset.protected FeatureCollectioncreateFeatureCollection()protected voiddeleteTableQuery(SpatialDatabasesDSConnection conn)Execute a query on this connection to DROP this table as well as its reference in the PostGIS's geometry_columns table (PostGIS < 2).voidfinalizeUpdate(SpatialDatabasesDSConnection conn)After a new postgis table has been create, it is useful to execute a VACUUM ANALYZE in order to update indexes and get a precise estimated_extent.protected intgetTableSRID(Connection conn, String column)-
Methods inherited from class org.openjump.core.ui.plugin.datastore.WritableDataStoreDataSource
addCreation, addModification, addSuppression, getConnection, getGeometryDimension, getGeometryType, getIndexedEvolutions, getUncommittedEvolutions, getViewEnvelope, insertStatement, isWritable, removeEvolution, setAttributeValues, setCoordDimension, setLimitedToView, setManageConflicts, setMultiGeometry, setSRID, setTableAlreadyCreated
-
Methods inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreDataSource
getWorkbenchContext, setMaxFeature, setWhereClause, setWorkbenchContext
-
Methods inherited from class com.vividsolutions.jump.workbench.ui.plugin.datastore.DataStoreQueryDataSource
expandQuery
-
Methods inherited from class com.vividsolutions.jump.io.datasource.DataSource
getProperties, installCoordinateSystem, isDisabled, isReadable, setDisabled, setProperties
-
-
-
-
Constructor Detail
-
H2DataStoreDataSource
public H2DataStoreDataSource()
-
H2DataStoreDataSource
public H2DataStoreDataSource(WorkbenchContext context)
-
H2DataStoreDataSource
public H2DataStoreDataSource(ConnectionDescriptor connectionDescriptor, String datasetName, String geometryAttributeName, String identifierAttributeName, String txManagerClass, WorkbenchContext context)
-
-
Method Detail
-
finalizeUpdate
public void finalizeUpdate(SpatialDatabasesDSConnection conn) throws Exception
After a new postgis table has been create, it is useful to execute a VACUUM ANALYZE in order to update indexes and get a precise estimated_extent.- Specified by:
finalizeUpdatein classWritableDataStoreDataSource- Parameters:
conn- the Connection to use to finalize the update- Throws:
Exception- if an Exception occurs during update finalization
-
createFeatureCollection
protected FeatureCollection createFeatureCollection() throws Exception
- Overrides:
createFeatureCollectionin classDataStoreDataSource- Throws:
Exception
-
deleteTableQuery
protected void deleteTableQuery(SpatialDatabasesDSConnection conn) throws SQLException
Execute a query on this connection to DROP this table as well as its reference in the PostGIS's geometry_columns table (PostGIS < 2).- Specified by:
deleteTableQueryin classWritableDataStoreDataSource- Parameters:
conn- connection to use to delete the table- Throws:
SQLException- if the server returns an exception while deleting
-
createAndPopulateTable
protected void createAndPopulateTable(SpatialDatabasesDSConnection conn, FeatureCollection fc, int srid, String geometryType, boolean multi, int dim, boolean normalizedColumnNames) throws SQLException
Create and populate a table with features from a dataset.- Specified by:
createAndPopulateTablein classWritableDataStoreDataSource- Parameters:
conn- connection to the databasefc- featureCollection to upload to the databasesrid- srid of the geometrygeometryType- geometry typedim- geometry dimensionnormalizedColumnNames- whether columns names have to be normalized or notmulti- true to force geometry to be a MultiGeometry- Throws:
SQLException- if an Exception occurs while accessing database
-
addDBPrimaryKey
protected void addDBPrimaryKey(SpatialDatabasesDSConnection conn, String primaryKey) throws SQLException
Description copied from class:WritableDataStoreDataSourceAdd an automatically named primary key constraint to the table.- Specified by:
addDBPrimaryKeyin classWritableDataStoreDataSource- Parameters:
conn- the Connection to use to add the Primary KeyprimaryKey- the column name for th primary key- Throws:
SQLException- if an exception occurs during primary key addition
-
getTableSRID
protected int getTableSRID(Connection conn, String column) throws SQLException
- Specified by:
getTableSRIDin classWritableDataStoreDataSource- Throws:
SQLException
-
-