public class StorageOptions
extends java.lang.Object
Options for offline storage of data from a DataService
.
Modifier and Type | Field and Description |
---|---|
static int |
STORE_BOOLEAN_AS_NUMBER_1_0
Store boolean values as numbers 1 (true) and 0 (false).
|
static int |
STORE_BOOLEAN_AS_SQL_BOOLEAN
Store boolean values as SQL boolean type.
|
static int |
STORE_BOOLEAN_AS_STRING_Y_N
Store boolean values as strings "Y" (true) and "N" (false).
|
Constructor and Description |
---|
StorageOptions() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getBackendEtagColumn()
Return where applicable, holds the column name used to hold the backend ETag.
|
int |
getBackendEtagLength()
Return backend ETag length.
|
java.lang.String |
getClientIDColumn()
Return where applicable, holds the column name used to hold the client ID.
|
boolean |
getCreateTables()
Return should the data service create tables if they don't exist already (defaults to
true ). |
java.lang.String |
getDatabaseFile()
Return (nullable) Name of database file on local file system.
|
java.lang.String |
getDatabaseName()
Return (nullable) Name of the database.
|
java.lang.String |
getDatabasePassword()
Return (nullable) Database password.
|
java.lang.String |
getDatabaseType()
Return (nullable) Type of database, e.g.
|
java.lang.String |
getDatabaseURL()
Return (nullable) Database connection string.
|
java.lang.String |
getDatabaseUsername()
Return (nullable) Database username.
|
javax.sql.DataSource |
getDataSource()
Get the optional JDBC DataSource for use by SQLDatabaseProvider.
|
int |
getDefaultLength()
Return the default
Property.maxLength when not specified for varying-length columns. |
int |
getDefaultPrecision()
Return the default
Property.precision when not specified for decimal/integer columns. |
java.lang.String |
getDriverClass()
Return (nullable) Database connection class.
|
java.lang.String |
getDriverLibrary()
Return (nullable) Database connection library.
|
int |
getDurationPrecision()
Return the precision for decimal storage of
DayTimeDuration values (expressed as seconds with optional fraction). |
int |
getDurationScale()
Return the scale for decimal storage of
DayTimeDuration values (expressed as seconds with optional fraction). |
java.lang.String |
getInternalClobColumn()
Return column name for CLOB storage of entity internal data.
|
java.lang.String |
getInternalDataColumn()
Return column name for non-CLOB storage of entity internal data.
|
int |
getInternalDataLength()
Return length of non-CLOB column for storage of internal data.
|
java.lang.String |
getLastModifiedColumn()
Return if
SQLDatabaseProvider.enableChangeTracking is true , this holds the column name used for identifying the modification time of rows. |
int |
getLongestNonLOB()
Return the longest permitted length for a non-BLOB/CLOB column (e.g.
|
java.lang.String |
getMediaEtagColumnSuffix()
Return if
StorageOptions.storeMediaEtag is true , then the column name suffix used for storing entity tag. |
java.lang.String |
getMediaTypeColumnSuffix()
Return if
StorageOptions.storeMediaType is true , then the column name suffix used for storing media type. |
java.lang.String |
getOfflineKeyColumn()
Return where applicable, holds the column name used to hold the offline key.
|
boolean |
getOfflineLinks()
Return enables offline storage of links for navigation properties.
|
java.lang.String |
getOfflineStateColumn()
Return where applicable, holds the column name used to hold the offline state.
|
boolean |
getPoolConnections()
Return is pooling of database connections permitted? Defaults to
false . |
java.lang.String |
getRowVersionColumn()
Return where applicable, holds the column name used to hold the row version.
|
java.lang.String |
getSchemaName()
Return (nullable) Optional schema name for all tables in this schema.
|
java.lang.String |
getSchemaVersion()
Return (nullable) Optional schema version for all tables in this schema.
|
boolean |
getStoreBackendEtag()
Return should backend entity tag be stored (in a separate column from row version)? Defaults to
false . |
int |
getStoreBooleanAsType()
Return option for storage of boolean properties.
|
boolean |
getStoreInternalData()
Return enable storing of entity internal data in the database (where applicable).
|
boolean |
getStoreMediaEtag()
Return should entity tag be stored (in a separate column from media data)? Defaults to
true . |
boolean |
getStoreMediaType()
Return should media type be stored (in a separate column from media data)? Defaults to
true . |
java.lang.String |
getTablePrefix()
Return (nullable) Optional prefix for all table names in this schema.
|
java.lang.String |
getTableSuffix()
Return (nullable) Optional suffix for all table names in this schema.
|
java.lang.String |
getTenantIDColumn()
Return tenant identifier column.
|
int |
getVariableScale()
Return the maximum
Property.scale when specified as 'variable' for decimal columns. |
java.lang.String |
isDeletedColumn()
Return if
SQLDatabaseProvider.enableChangeTracking is true , this holds the column name used for identifying the deletion status of rows. |
boolean |
isEmbedded()
Return is the database embedded within the application? Defaults to
false . |
void |
setBackendEtagColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the backend ETag.
|
void |
setBackendEtagLength(int value)
Set backend ETag length.
|
void |
setClientIDColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the client ID.
|
void |
setCreateTables(boolean value)
Set should the data service create tables if they don't exist already (defaults to
true ). |
void |
setDatabaseFile(java.lang.String value)
Set name of database file on local file system.
|
void |
setDatabaseName(java.lang.String value)
Set name of the database.
|
void |
setDatabasePassword(java.lang.String value)
Set database password.
|
void |
setDatabaseType(java.lang.String value)
Set type of database, e.g.
|
void |
setDatabaseURL(java.lang.String value)
Set database connection string.
|
void |
setDatabaseUsername(java.lang.String value)
Set database username.
|
void |
setDataSource(javax.sql.DataSource dataSource)
Set the optional JDBC DataSource for use by SQLDatabaseProvider.
|
void |
setDefaultLength(int value)
Set the default
Property.maxLength when not specified for varying-length columns. |
void |
setDefaultPrecision(int value)
Set the default
Property.precision when not specified for decimal/integer columns. |
void |
setDeletedColumn(java.lang.String value)
Set if
SQLDatabaseProvider.enableChangeTracking is true , this holds the column name used for identifying the deletion status of rows. |
void |
setDriverClass(java.lang.String value)
Set database connection class.
|
void |
setDriverLibrary(java.lang.String value)
Set database connection library.
|
void |
setDurationPrecision(int value)
Set the precision for decimal storage of
DayTimeDuration values (expressed as seconds with optional fraction). |
void |
setDurationScale(int value)
Set the scale for decimal storage of
DayTimeDuration values (expressed as seconds with optional fraction). |
void |
setEmbedded(boolean value)
Set is the database embedded within the application? Defaults to
false . |
void |
setInternalClobColumn(java.lang.String value)
Set column name for CLOB storage of entity internal data.
|
void |
setInternalDataColumn(java.lang.String value)
Set column name for non-CLOB storage of entity internal data.
|
void |
setInternalDataLength(int value)
Set length of non-CLOB column for storage of internal data.
|
void |
setLastModifiedColumn(java.lang.String value)
Set if
SQLDatabaseProvider.enableChangeTracking is true , this holds the column name used for identifying the modification time of rows. |
void |
setLongestNonLOB(int value)
Set the longest permitted length for a non-BLOB/CLOB column (e.g.
|
void |
setMediaEtagColumnSuffix(java.lang.String value)
Set if
StorageOptions.storeMediaEtag is true , then the column name suffix used for storing entity tag. |
void |
setMediaTypeColumnSuffix(java.lang.String value)
Set if
StorageOptions.storeMediaType is true , then the column name suffix used for storing media type. |
void |
setOfflineKeyColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the offline key.
|
void |
setOfflineLinks(boolean value)
Set enables offline storage of links for navigation properties.
|
void |
setOfflineStateColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the offline state.
|
void |
setPoolConnections(boolean value)
Set is pooling of database connections permitted? Defaults to
false . |
void |
setRowVersionColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the row version.
|
void |
setSchemaName(java.lang.String value)
Set optional schema name for all tables in this schema.
|
void |
setSchemaVersion(java.lang.String value)
Set optional schema version for all tables in this schema.
|
void |
setStoreBackendEtag(boolean value)
Set should backend entity tag be stored (in a separate column from row version)? Defaults to
false . |
void |
setStoreBooleanAsType(int value)
Set option for storage of boolean properties.
|
void |
setStoreInternalData(boolean value)
Set enable storing of entity internal data in the database (where applicable).
|
void |
setStoreMediaEtag(boolean value)
Set should entity tag be stored (in a separate column from media data)? Defaults to
true . |
void |
setStoreMediaType(boolean value)
Set should media type be stored (in a separate column from media data)? Defaults to
true . |
void |
setTablePrefix(java.lang.String value)
Set optional prefix for all table names in this schema.
|
void |
setTableSuffix(java.lang.String value)
Set optional suffix for all table names in this schema.
|
void |
setTenantIDColumn(java.lang.String value)
Set tenant identifier column.
|
void |
setVariableScale(int value)
Set the maximum
Property.scale when specified as 'variable' for decimal columns. |
public static final int STORE_BOOLEAN_AS_SQL_BOOLEAN
Store boolean values as SQL boolean type.
public static final int STORE_BOOLEAN_AS_NUMBER_1_0
Store boolean values as numbers 1 (true) and 0 (false).
public static final int STORE_BOOLEAN_AS_STRING_Y_N
Store boolean values as strings "Y" (true) and "N" (false).
public javax.sql.DataSource getDataSource()
public void setDataSource(javax.sql.DataSource dataSource)
dataSource
- JDBC Data Source.public java.lang.String getBackendEtagColumn()
Return where applicable, holds the column name used to hold the backend ETag. Otherwise unused. Defaults to "backend_etag".
public int getBackendEtagLength()
Return backend ETag length.
public java.lang.String getClientIDColumn()
Return where applicable, holds the column name used to hold the client ID. Otherwise unused. Defaults to "client_id".
public boolean getCreateTables()
Return should the data service create tables if they don't exist already (defaults to true
).
true
).public java.lang.String getDatabaseFile()
Return (nullable) Name of database file on local file system.
public java.lang.String getDatabaseName()
Return (nullable) Name of the database.
Used as a base name for the StorageOptions.databaseFile
.
public java.lang.String getDatabasePassword()
Return (nullable) Database password.
public java.lang.String getDatabaseType()
Return (nullable) Type of database, e.g. "SQL Anywhere 16.0";
public java.lang.String getDatabaseURL()
Return (nullable) Database connection string.
public java.lang.String getDatabaseUsername()
Return (nullable) Database username.
public int getDefaultLength()
Return the default Property.maxLength
when not specified for varying-length columns. Defaults to 500.
Property.maxLength
when not specified for varying-length columns. Defaults to 500.public int getDefaultPrecision()
Return the default Property.precision
when not specified for decimal/integer columns. Defaults to 25.
Property.precision
when not specified for decimal/integer columns. Defaults to 25.public java.lang.String getDriverClass()
Return (nullable) Database connection class.
public java.lang.String getDriverLibrary()
Return (nullable) Database connection library.
public int getDurationPrecision()
Return the precision for decimal storage of DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 20.
DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 20.public int getDurationScale()
Return the scale for decimal storage of DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 6.
DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 6.public java.lang.String getInternalClobColumn()
Return column name for CLOB storage of entity internal data.
public java.lang.String getInternalDataColumn()
Return column name for non-CLOB storage of entity internal data.
public int getInternalDataLength()
Return length of non-CLOB column for storage of internal data.
public java.lang.String getLastModifiedColumn()
Return if SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the modification time of rows. Otherwise unused.
Defaults to "last_modified".
SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the modification time of rows. Otherwise unused.public int getLongestNonLOB()
Return the longest permitted length for a non-BLOB/CLOB column (e.g. varbinary/varchar). Defaults to 5000. Column storage for columns needing more than this length will use BLOB/CLOB types.
public java.lang.String getMediaEtagColumnSuffix()
Return if StorageOptions.storeMediaEtag
is true
, then the column name suffix used for storing entity tag.
StorageOptions.storeMediaEtag
is true
, then the column name suffix used for storing entity tag.public java.lang.String getMediaTypeColumnSuffix()
Return if StorageOptions.storeMediaType
is true
, then the column name suffix used for storing media type.
StorageOptions.storeMediaType
is true
, then the column name suffix used for storing media type.public java.lang.String getOfflineKeyColumn()
Return where applicable, holds the column name used to hold the offline key. Otherwise unused. Defaults to "offline_key".
public boolean getOfflineLinks()
Return enables offline storage of links for navigation properties.
public java.lang.String getOfflineStateColumn()
Return where applicable, holds the column name used to hold the offline state. Otherwise unused. Defaults to "offline_state".
public boolean getPoolConnections()
Return is pooling of database connections permitted? Defaults to false
.
Should be set to false
in application server environments with container-managed connections
that cannot be safely reused across requests.
false
.public java.lang.String getRowVersionColumn()
Return where applicable, holds the column name used to hold the row version. Otherwise unused. Defaults to "row_version".
public java.lang.String getSchemaName()
Return (nullable) Optional schema name for all tables in this schema.
public java.lang.String getSchemaVersion()
Return (nullable) Optional schema version for all tables in this schema.
public boolean getStoreBackendEtag()
Return should backend entity tag be stored (in a separate column from row version)? Defaults to false
.
false
.public int getStoreBooleanAsType()
Return option for storage of boolean properties. Defaults to STORE_BOOLEAN_AS_SQL_BOOLEAN.
STORE_BOOLEAN_AS_NUMBER_1_0, STORE_BOOLEAN_AS_STRING_Y_N.
public boolean getStoreInternalData()
Return enable storing of entity internal data in the database (where applicable). Defaults to false
.
public boolean getStoreMediaEtag()
Return should entity tag be stored (in a separate column from media data)? Defaults to true
.
true
.public boolean getStoreMediaType()
Return should media type be stored (in a separate column from media data)? Defaults to true
.
true
.public java.lang.String getTablePrefix()
Return (nullable) Optional prefix for all table names in this schema.
public java.lang.String getTableSuffix()
Return (nullable) Optional suffix for all table names in this schema.
public java.lang.String getTenantIDColumn()
Return tenant identifier column.
public int getVariableScale()
Return the maximum Property.scale
when specified as 'variable' for decimal columns. Defaults to 10.
Property.scale
when specified as 'variable' for decimal columns. Defaults to 10.public java.lang.String isDeletedColumn()
Return if SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the deletion status of rows. Otherwise unused.
Defaults to "is_deleted".
SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the deletion status of rows. Otherwise unused.public boolean isEmbedded()
Return is the database embedded within the application? Defaults to false
.
false
.public void setBackendEtagColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the backend ETag. Otherwise unused. Defaults to "backend_etag".
value
- Where applicable, holds the column name used to hold the backend ETag. Otherwise unused.public void setBackendEtagLength(int value)
Set backend ETag length.
value
- Backend ETag length.public void setClientIDColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the client ID. Otherwise unused. Defaults to "client_id".
value
- Where applicable, holds the column name used to hold the client ID. Otherwise unused.public void setCreateTables(boolean value)
Set should the data service create tables if they don't exist already (defaults to true
).
value
- Should the data service create tables if they don't exist already (defaults to true
).public void setDatabaseFile(java.lang.String value)
Set name of database file on local file system.
value
- Name of database file on local file system.public void setDatabaseName(java.lang.String value)
Set name of the database.
Used as a base name for the StorageOptions.databaseFile
.
value
- Name of the database.public void setDatabasePassword(java.lang.String value)
Set database password.
value
- Database password.public void setDatabaseType(java.lang.String value)
Set type of database, e.g. "SQL Anywhere 16.0";
value
- Type of database, e.g. "SQL Anywhere 16.0";public void setDatabaseURL(java.lang.String value)
Set database connection string.
value
- Database connection string.public void setDatabaseUsername(java.lang.String value)
Set database username.
value
- Database username.public void setDefaultLength(int value)
Set the default Property.maxLength
when not specified for varying-length columns. Defaults to 500.
value
- The default Property.maxLength
when not specified for varying-length columns. Defaults to 500.public void setDefaultPrecision(int value)
Set the default Property.precision
when not specified for decimal/integer columns. Defaults to 25.
value
- The default Property.precision
when not specified for decimal/integer columns. Defaults to 25.public void setDeletedColumn(java.lang.String value)
Set if SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the deletion status of rows. Otherwise unused.
Defaults to "is_deleted".
value
- If SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the deletion status of rows. Otherwise unused.public void setDriverClass(java.lang.String value)
Set database connection class.
value
- Database connection class.public void setDriverLibrary(java.lang.String value)
Set database connection library.
value
- Database connection library.public void setDurationPrecision(int value)
Set the precision for decimal storage of DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 20.
value
- The precision for decimal storage of DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 20.public void setDurationScale(int value)
Set the scale for decimal storage of DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 6.
value
- The scale for decimal storage of DayTimeDuration
values (expressed as seconds with optional fraction). Defaults to 6.public void setEmbedded(boolean value)
Set is the database embedded within the application? Defaults to false
.
value
- Is the database embedded within the application? Defaults to false
.public void setInternalClobColumn(java.lang.String value)
Set column name for CLOB storage of entity internal data.
value
- Column name for CLOB storage of entity internal data.public void setInternalDataColumn(java.lang.String value)
Set column name for non-CLOB storage of entity internal data.
value
- Column name for non-CLOB storage of entity internal data.public void setInternalDataLength(int value)
Set length of non-CLOB column for storage of internal data.
value
- Length of non-CLOB column for storage of internal data.public void setLastModifiedColumn(java.lang.String value)
Set if SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the modification time of rows. Otherwise unused.
Defaults to "last_modified".
value
- If SQLDatabaseProvider.enableChangeTracking
is true
, this holds the column name used for identifying the modification time of rows. Otherwise unused.public void setLongestNonLOB(int value)
Set the longest permitted length for a non-BLOB/CLOB column (e.g. varbinary/varchar). Defaults to 5000. Column storage for columns needing more than this length will use BLOB/CLOB types.
value
- The longest permitted length for a non-BLOB/CLOB column (e.g. varbinary/varchar). Defaults to 5000.public void setMediaEtagColumnSuffix(java.lang.String value)
Set if StorageOptions.storeMediaEtag
is true
, then the column name suffix used for storing entity tag.
value
- If StorageOptions.storeMediaEtag
is true
, then the column name suffix used for storing entity tag.public void setMediaTypeColumnSuffix(java.lang.String value)
Set if StorageOptions.storeMediaType
is true
, then the column name suffix used for storing media type.
value
- If StorageOptions.storeMediaType
is true
, then the column name suffix used for storing media type.public void setOfflineKeyColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the offline key. Otherwise unused. Defaults to "offline_key".
value
- Where applicable, holds the column name used to hold the offline key. Otherwise unused.public void setOfflineLinks(boolean value)
Set enables offline storage of links for navigation properties.
value
- Enables offline storage of links for navigation properties.public void setOfflineStateColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the offline state. Otherwise unused. Defaults to "offline_state".
value
- Where applicable, holds the column name used to hold the offline state. Otherwise unused.public void setPoolConnections(boolean value)
Set is pooling of database connections permitted? Defaults to false
.
Should be set to false
in application server environments with container-managed connections
that cannot be safely reused across requests.
value
- Is pooling of database connections permitted? Defaults to false
.public void setRowVersionColumn(java.lang.String value)
Set where applicable, holds the column name used to hold the row version. Otherwise unused. Defaults to "row_version".
value
- Where applicable, holds the column name used to hold the row version. Otherwise unused.public void setSchemaName(java.lang.String value)
Set optional schema name for all tables in this schema.
value
- Optional schema name for all tables in this schema.public void setSchemaVersion(java.lang.String value)
Set optional schema version for all tables in this schema.
value
- Optional schema version for all tables in this schema.public void setStoreBackendEtag(boolean value)
Set should backend entity tag be stored (in a separate column from row version)? Defaults to false
.
value
- Should backend entity tag be stored (in a separate column from row version)? Defaults to false
.public void setStoreBooleanAsType(int value)
Set option for storage of boolean properties. Defaults to STORE_BOOLEAN_AS_SQL_BOOLEAN.
STORE_BOOLEAN_AS_NUMBER_1_0, STORE_BOOLEAN_AS_STRING_Y_N.
value
- Option for storage of boolean properties. Defaults to STORE_BOOLEAN_AS_SQL_BOOLEAN.public void setStoreInternalData(boolean value)
Set enable storing of entity internal data in the database (where applicable). Defaults to false
.
value
- Enable storing of entity internal data in the database (where applicable). Defaults to `false`.public void setStoreMediaEtag(boolean value)
Set should entity tag be stored (in a separate column from media data)? Defaults to true
.
value
- Should entity tag be stored (in a separate column from media data)? Defaults to true
.public void setStoreMediaType(boolean value)
Set should media type be stored (in a separate column from media data)? Defaults to true
.
value
- Should media type be stored (in a separate column from media data)? Defaults to true
.public void setTablePrefix(java.lang.String value)
Set optional prefix for all table names in this schema.
value
- Optional prefix for all table names in this schema.public void setTableSuffix(java.lang.String value)
Set optional suffix for all table names in this schema.
value
- Optional suffix for all table names in this schema.public void setTenantIDColumn(java.lang.String value)
Set tenant identifier column.
value
- Tenant identifier column.public void setVariableScale(int value)
Set the maximum Property.scale
when specified as 'variable' for decimal columns. Defaults to 10.
value
- The maximum Property.scale
when specified as 'variable' for decimal columns. Defaults to 10.