Class AbstractDBStoreParameters

java.lang.Object
org.gvsig.fmap.dal.spi.AbstractDataParameters
org.gvsig.fmap.dal.spi.AbstractDataStoreParameters
org.gvsig.fmap.dal.store.db.AbstractDBStoreParameters
All Implemented Interfaces:
org.gvsig.fmap.dal.DataParameters, org.gvsig.fmap.dal.DataStoreParameters, org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters, org.gvsig.fmap.dal.OpenDataStoreParameters, org.gvsig.fmap.dal.resource.db.DBParameters, org.gvsig.fmap.dal.serverexplorer.db.DBConnectionParameter, org.gvsig.fmap.dal.store.db.DBStoreParameters, org.gvsig.json.SupportFromJson, org.gvsig.json.SupportToJson, org.gvsig.tools.dynobject.DynObject, org.gvsig.tools.persistence.Persistent, org.gvsig.tools.util.Validator

public abstract class AbstractDBStoreParameters extends org.gvsig.fmap.dal.spi.AbstractDataStoreParameters implements org.gvsig.fmap.dal.store.db.DBStoreParameters
Abstract Data base Store Parameters
Author:
jmvivo
  • Field Summary

    Fields inherited from interface org.gvsig.fmap.dal.DataParameters

    CRS_PARAMTER_NAME

    Fields inherited from interface org.gvsig.fmap.dal.resource.db.DBParameters

    DBNAME_PARAMTER_NAME, HOST_PARAMTER_NAME, PASSWORD_PARAMTER_NAME, PORT_PARAMTER_NAME, USER_PARAMTER_NAME

    Fields inherited from interface org.gvsig.fmap.dal.store.db.DBStoreParameters

    BASEFILTER_PARAMTER_NAME, BASEORDER_PARAMTER_NAME, DEFAULTGEOMETRY_PARAMTER_NAME, FIELDS_PARAMTER_NAME, GEOMETRYSUBTYPE_PARAMTER_NAME, GEOMETRYTYPE_PARAMTER_NAME, PARAMETERS_DEFINITION_NAME, PKFIELDS_PARAMTER_NAME, SQL_PARAMTER_NAME, TABLE_PARAMTER_NAME, WORKINGAREA_PARAMTER_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractDBStoreParameters(String parametersDefinitionName, String providerName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get initial filter to use.

    This filter is passed to BD provider on each request as a base filter.
    Get initial order to use.

    This order is used if no custom order is request in query.
    org.gvsig.crs.projection.lib.Projection
    Get the SRS id string set manually for the default geometry field of this layer.

    if is set to null means that the library must detect it automatically.

    Supported only for stores with geometric fields.
     
     
    Return the geometry field to use like default geometry (see Feature.getDefaultGeometry())

    This option is supported only in geometry providers.
    If this parameters is not set and store has only one field geometry then library uses that field as default
    protected org.gvsig.tools.dynobject.DelegatedDynObject
     
     
    Get an array of the field names that we want to use.

    A null means that we want all fields available.
    Get a comma separated list of the field names that we want to use.

    A null or empty string means that we want all fields available.
    int
     
    int
     
     
     
    Get an array of the field names that compound the primary key.

    A null or empty string means that library must detect this information.

    Note: see getPkFieldsString()
    Get a comma separated list of the field names that compound the primary key.

    A null or empty string means that library must detect this information.

    Note:If this parameters is undefined, the library can't do this detection, some services will don't be available for this store (like selection, editing or Feature.getReference())
     
    Get the SQL to use as source of the store instead a table or a view.

    If this property is set the store changes his work flow: store is in read only mode. table property is ignored. pkFields is not identified automatically filter and order will be resolved locally (pour performance)
    Get table parameter value

    This parameters describes what table or view we want to connect.
    Not used if sql parameter set.
     
    org.gvsig.fmap.geom.primitive.Envelope
    Get the filter by area of getDefaultGeometryField() used in this store.

    Supported only for stores with geometric fields
    boolean
     
    void
    Set initial filter to use.

    This filter is passed to BD provider on each request as a base filter.
    void
    Set initial order to use.

    This order is used if no custom order is request in query.
    void
     
    void
    setCRS(org.gvsig.crs.projection.lib.Projection srs)
    Set manually the SRS for the default geometry field of this layer.

    if is set to null or empty string means that the library must detect it automatically.

    Supported only for stores with geometric fields.
    void
    setDBName(String dbName)
    Set data base name/code> parameter value
    void
    Set the geometry field to use like default geometry.
    See getDefaultGeometryField() for description.
    void
    setFields(String fields)
    Set a comma separated list of the field names that we want to use.

    A null means that we want all fields available.
    void
    setFields(String[] fields)
    Set an array of the field names that we want to use.

    A null means that we want all fields available.
    void
    setGeometrySubtype(int geometrySubtype)
     
    void
    setGeometryType(int geometryType)
     
    void
     
    void
    setPassword(String password)
    Set password/code> parameter value
    void
    Set a comma separated list of the field names that compound the primary key.

    A null or empty string means that library must detect this information.

    Note: see getPkFieldsString()
    void
    setPkFields(String[] fields)
    Set an array of the field names that compound the primary key.

    A null or empty string means that library must detect this information.

    Note: see getPkFieldsString()
    void
    setPort(int port)
     
    void
    Set port/code> parameter value
    void
    Set the SQL to use as source of the store instead a table or a view.

    Note:see getSQL() for description
    void
    Set table parameter value

    This parameters describes what table or view we want to connect.
    Not used if sql parameter set.
    void
    Set user/code> parameter value
    void
    setWorkingArea(org.gvsig.fmap.geom.primitive.Envelope workingArea)
    Set the filter by area of getDefaultGeometryField() used in this store.

    Supported only for stores with geometric fields

    Methods inherited from class org.gvsig.fmap.dal.spi.AbstractDataStoreParameters

    getSourceId, isTheSameExplorer, isTheSameStore

    Methods inherited from class org.gvsig.fmap.dal.spi.AbstractDataParameters

    clear, copyValuesTo, delegate, equals, fromByteArray, fromJson, getCause, getCopy, getDynClass, getDynValue, getMessage, getProviderName, hasDynValue, hashCode, implement, invokeDynMethod, invokeDynMethod, isValid, loadFromState, loadPRJ, loadWLD, saveToState, setDynValue, toByteArray, toJson, toJsonBuilder, toString, toString, validate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.gvsig.fmap.dal.DataParameters

    clear, getCopy, toByteArray, toString, validate

    Methods inherited from interface org.gvsig.fmap.dal.DataStoreParameters

    getProviderName, getSourceId, isTheSameExplorer, isTheSameStore

    Methods inherited from interface org.gvsig.tools.dynobject.DynObject

    delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValue

    Methods inherited from interface org.gvsig.tools.persistence.Persistent

    loadFromState, saveToState

    Methods inherited from interface org.gvsig.json.SupportFromJson

    fromJson

    Methods inherited from interface org.gvsig.json.SupportToJson

    toJson, toJson, toJsonBuilder, toJsonBuilder
  • Constructor Details

    • AbstractDBStoreParameters

      public AbstractDBStoreParameters(String parametersDefinitionName, String providerName)
  • Method Details

    • getDelegatedDynObject

      protected org.gvsig.tools.dynobject.DelegatedDynObject getDelegatedDynObject()
      Specified by:
      getDelegatedDynObject in class org.gvsig.fmap.dal.spi.AbstractDataParameters
    • getDataStoreName

      public String getDataStoreName()
      Specified by:
      getDataStoreName in interface org.gvsig.fmap.dal.DataStoreParameters
      Specified by:
      getDataStoreName in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Overrides:
      getDataStoreName in class org.gvsig.fmap.dal.spi.AbstractDataParameters
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.gvsig.fmap.dal.DataStoreParameters
      Specified by:
      getDescription in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Overrides:
      getDescription in class org.gvsig.fmap.dal.spi.AbstractDataParameters
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface org.gvsig.fmap.dal.DataStoreParameters
      Specified by:
      isValid in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • getHost

      public String getHost()
      Specified by:
      getHost in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      getHost in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • getPort

      public Integer getPort()
      Specified by:
      getPort in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      getPort in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • getDBName

      public String getDBName()
      Specified by:
      getDBName in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      getDBName in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • getUser

      public String getUser()
      Specified by:
      getUser in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      getUser in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • getPassword

      public String getPassword()
      Specified by:
      getPassword in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      getPassword in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • setHost

      public void setHost(String host)
      Specified by:
      setHost in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      setHost in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • setPort

      public void setPort(int port)
      Specified by:
      setPort in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • setPort

      public void setPort(Integer port)
      Set port/code> parameter value
      Specified by:
      setPort in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      setPort in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Parameters:
      port -
    • setDBName

      public void setDBName(String dbName)
      Set data base name/code> parameter value
      Specified by:
      setDBName in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      setDBName in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Parameters:
      data - base name
    • setUser

      public void setUser(String user)
      Set user/code> parameter value
      Specified by:
      setUser in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      setUser in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Parameters:
      user -
    • setPassword

      public void setPassword(String password)
      Set password/code> parameter value
      Specified by:
      setPassword in interface org.gvsig.fmap.dal.resource.db.DBParameters
      Specified by:
      setPassword in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Parameters:
      password -
    • getTable

      public String getTable()
      Get table parameter value

      This parameters describes what table or view we want to connect.
      Not used if sql parameter set.
      Specified by:
      getTable in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Parameters:
      password -
      See Also:
    • setTable

      public void setTable(String table)
      Set table parameter value

      This parameters describes what table or view we want to connect.
      Not used if sql parameter set.
      Specified by:
      setTable in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Parameters:
      password -
      See Also:
    • getFieldsString

      public String getFieldsString()
      Get a comma separated list of the field names that we want to use.

      A null or empty string means that we want all fields available.
      Specified by:
      getFieldsString in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      See Also:
    • getFields

      public String[] getFields()
      Get an array of the field names that we want to use.

      A null means that we want all fields available.
      Specified by:
      getFields in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      See Also:
    • setFields

      public void setFields(String fields)
      Set a comma separated list of the field names that we want to use.

      A null means that we want all fields available.
      Specified by:
      setFields in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
    • setFields

      public void setFields(String[] fields)
      Set an array of the field names that we want to use.

      A null means that we want all fields available.
      Specified by:
      setFields in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
    • getSQL

      public String getSQL()
      Get the SQL to use as source of the store instead a table or a view.

      If this property is set the store changes his work flow:
      • store is in read only mode.
      • table property is ignored.
      • pkFields is not identified automatically
      • filter and order will be resolved locally (pour performance)
      Specified by:
      getSQL in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      sql to use
      See Also:
    • setSQL

      public void setSQL(String sql)
      Set the SQL to use as source of the store instead a table or a view.

      Note:see getSQL() for description
      Specified by:
      setSQL in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
    • getBaseFilter

      public String getBaseFilter()
      Get initial filter to use.

      This filter is passed to BD provider on each request as a base filter.
      Specified by:
      getBaseFilter in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      filter
      See Also:
    • setBaseFilter

      public void setBaseFilter(String filter)
      Set initial filter to use.

      This filter is passed to BD provider on each request as a base filter.
      Specified by:
      setBaseFilter in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
      • invalid reference
        #getInitialFilter(String)
    • getBaseOrder

      public String getBaseOrder()
      Get initial order to use.

      This order is used if no custom order is request in query.
      Specified by:
      getBaseOrder in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      order
      See Also:
    • setBaseOrder

      public void setBaseOrder(String order)
      Set initial order to use.

      This order is used if no custom order is request in query.
      Specified by:
      setBaseOrder in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
    • getPkFieldsString

      public String getPkFieldsString()
      Get a comma separated list of the field names that compound the primary key.

      A null or empty string means that library must detect this information.

      Note:If this parameters is undefined, the library can't do this detection, some services will don't be available for this store (like selection, editing or Feature.getReference())
      Specified by:
      getPkFieldsString in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      See Also:
    • getPkFields

      public String[] getPkFields()
      Get an array of the field names that compound the primary key.

      A null or empty string means that library must detect this information.

      Note: see getPkFieldsString()
      Specified by:
      getPkFields in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      See Also:
    • setPkFields

      public void setPkFields(String fields)
      Set a comma separated list of the field names that compound the primary key.

      A null or empty string means that library must detect this information.

      Note: see getPkFieldsString()
      Specified by:
      setPkFields in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
    • setPkFields

      public void setPkFields(String[] fields)
      Set an array of the field names that compound the primary key.

      A null or empty string means that library must detect this information.

      Note: see getPkFieldsString()
      Specified by:
      setPkFields in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
    • getDefaultGeometryField

      public String getDefaultGeometryField()
      Return the geometry field to use like default geometry (see Feature.getDefaultGeometry())

      This option is supported only in geometry providers.
      If this parameters is not set and store has only one field geometry then library uses that field as default
      Specified by:
      getDefaultGeometryField in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      See Also:
    • setDefaultGeometryField

      public void setDefaultGeometryField(String geomName)
      Set the geometry field to use like default geometry.
      See getDefaultGeometryField() for description.
      Specified by:
      setDefaultGeometryField in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Parameters:
      geomName -
      See Also:
    • getWorkingArea

      public org.gvsig.fmap.geom.primitive.Envelope getWorkingArea()
      Get the filter by area of getDefaultGeometryField() used in this store.

      Supported only for stores with geometric fields
      Specified by:
      getWorkingArea in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
    • setWorkingArea

      public void setWorkingArea(org.gvsig.fmap.geom.primitive.Envelope workingArea)
      Set the filter by area of getDefaultGeometryField() used in this store.

      Supported only for stores with geometric fields
      Specified by:
      setWorkingArea in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • setCRS

      public void setCRS(org.gvsig.crs.projection.lib.Projection srs)
      Set manually the SRS for the default geometry field of this layer.

      if is set to null or empty string means that the library must detect it automatically.

      Supported only for stores with geometric fields.
      Specified by:
      setCRS in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      See Also:
      • invalid reference
        #setSRSID(String)
      • invalid reference
        #getSRSID()
      • invalid reference
        #getSRS()
    • setCRS

      public void setCRS(String srs)
      Specified by:
      setCRS in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • getCRS

      public org.gvsig.crs.projection.lib.Projection getCRS()
      Get the SRS id string set manually for the default geometry field of this layer.

      if is set to null means that the library must detect it automatically.

      Supported only for stores with geometric fields.
      Specified by:
      getCRS in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
      Returns:
      See Also:
      • invalid reference
        #setSRSID(String)
      • invalid reference
        #getSRS()
      • invalid reference
        #setSRS(Projection)
    • getGeometryType

      public int getGeometryType()
      Specified by:
      getGeometryType in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • setGeometryType

      public void setGeometryType(int geometryType)
      Specified by:
      setGeometryType in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • getGeometrySubtype

      public int getGeometrySubtype()
      Specified by:
      getGeometrySubtype in interface org.gvsig.fmap.dal.store.db.DBStoreParameters
    • setGeometrySubtype

      public void setGeometrySubtype(int geometrySubtype)
      Specified by:
      setGeometrySubtype in interface org.gvsig.fmap.dal.store.db.DBStoreParameters