org.geotools.jdbc
Class JDBCState

Object
  extended by ContentState
      extended by JDBCState

public final class JDBCState
extends ContentState

State for jdbc datastore providing additional cached values such as primary key and database connection.

Author:
Jody Garnett, Refractions Research Inc., Justin Deoliveira, The Open Planning Project
Module:
modules/library/jdbc (gt-jdbc.jar)

Field Summary
 
Fields inherited from class ContentState
batchFeatureEvent, bounds, callback, count, entry, featureType, listeners, tx
 
Constructor Summary
JDBCState(ContentEntry entry)
          Creates a new state object.
JDBCState(JDBCState state)
          Creates the state from an existing one.
 
Method Summary
 void close()
          Closes the database connection with a call to JDBCDataStore.closeSafe(Connection).
 ContentState copy()
          Copies the state.
protected  void finalize()
           
 void flush()
          Flushes all cached state.
 Connection getConnection()
          The cached database connection.
 PrimaryKey getPrimaryKey()
          The cached primary key.
 boolean isExposePrimaryKeyColumns()
          Returns the flag indicating if columns which compose the primary key are exposed via the feature type.
 void setConnection(Connection connection)
          Sets the cached database connection.
 void setExposePrimaryKeyColumns(boolean exposePrimaryKeyColumns)
          Sets the flag indicating if columns which compose the primary key are exposed via the feature type.
 void setPrimaryKey(PrimaryKey primaryKey)
          Sets the cached primary key.
 
Methods inherited from class ContentState
addListener, fireBatchFeatureEvent, fireFeatureAdded, fireFeatureEvent, fireFeatureRemoved, fireFeatureUpdated, getBatchFeatureEvent, getBounds, getCount, getEntry, getFeatureType, getTransaction, hasListener, removeListener, setBounds, setCount, setFeatureType, setTransaction
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCState

public JDBCState(JDBCState state)
Creates the state from an existing one.


JDBCState

public JDBCState(ContentEntry entry)
Creates a new state object.

Method Detail

getConnection

public Connection getConnection()
The cached database connection.


setConnection

public void setConnection(Connection connection)
Sets the cached database connection.


getPrimaryKey

public PrimaryKey getPrimaryKey()
The cached primary key.


setPrimaryKey

public void setPrimaryKey(PrimaryKey primaryKey)
Sets the cached primary key.

Parameters:
primaryKey -

isExposePrimaryKeyColumns

public boolean isExposePrimaryKeyColumns()
Returns the flag indicating if columns which compose the primary key are exposed via the feature type.


setExposePrimaryKeyColumns

public void setExposePrimaryKeyColumns(boolean exposePrimaryKeyColumns)
Sets the flag indicating if columns which compose the primary key are exposed via the feature type.


flush

public void flush()
Flushes all cached state.

Overrides:
flush in class ContentState

copy

public ContentState copy()
Copies the state.

Overrides:
copy in class ContentState
Returns:
A copy of the state.

close

public void close()
Closes the database connection with a call to JDBCDataStore.closeSafe(Connection).

Overrides:
close in class ContentState

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 1996-2009 Geotools. All Rights Reserved.