public class JdbcMetadataStore
extends java.lang.Object
implements org.springframework.integration.metadata.ConcurrentMetadataStore, org.springframework.beans.factory.InitializingBean
MetadataStore using a relational database via JDBC.
SQL scripts to create the necessary tables are packaged as
org/springframework/integration/jdbc/schema-*.sql,
where * is the target database type.
The transaction management is required to use this MetadataStore.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TABLE_PREFIX
Default value for the table prefix property.
|
| Constructor and Description |
|---|
JdbcMetadataStore(javax.sql.DataSource dataSource)
Instantiate a
JdbcMetadataStore using provided dataSource DataSource. |
JdbcMetadataStore(org.springframework.jdbc.core.JdbcOperations jdbcOperations)
Instantiate a
JdbcMetadataStore using provided jdbcOperations JdbcOperations. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
java.lang.String |
get(java.lang.String key) |
void |
put(java.lang.String key,
java.lang.String value) |
java.lang.String |
putIfAbsent(java.lang.String key,
java.lang.String value) |
java.lang.String |
remove(java.lang.String key) |
boolean |
replace(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue) |
void |
setLockHint(java.lang.String lockHint)
Specify a row lock hint for the query in the lock-based operations.
|
void |
setRegion(java.lang.String region)
A unique grouping identifier for all messages persisted with this store.
|
void |
setTablePrefix(java.lang.String tablePrefix)
Public setter for the table prefix property.
|
public static final java.lang.String DEFAULT_TABLE_PREFIX
public JdbcMetadataStore(javax.sql.DataSource dataSource)
JdbcMetadataStore using provided dataSource DataSource.dataSource - a DataSourcepublic JdbcMetadataStore(org.springframework.jdbc.core.JdbcOperations jdbcOperations)
JdbcMetadataStore using provided jdbcOperations JdbcOperations.jdbcOperations - a JdbcOperationspublic void setTablePrefix(java.lang.String tablePrefix)
DEFAULT_TABLE_PREFIX.tablePrefix - the tablePrefix to setpublic void setRegion(java.lang.String region)
DEFAULT.region - the region name to setpublic void setLockHint(java.lang.String lockHint)
FOR UPDATE. Can be specified as an empty string,
if the target RDBMS doesn't support locking on tables from queries.
The value depends from RDBMS vendor, e.g. SQL Server requires WITH (ROWLOCK).lockHint - the RDBMS vendor-specific lock hint.public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean@Transactional
public java.lang.String putIfAbsent(java.lang.String key,
java.lang.String value)
putIfAbsent in interface org.springframework.integration.metadata.ConcurrentMetadataStore@Transactional
public boolean replace(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue)
replace in interface org.springframework.integration.metadata.ConcurrentMetadataStore@Transactional
public void put(java.lang.String key,
java.lang.String value)
put in interface org.springframework.integration.metadata.MetadataStore@Transactional public java.lang.String get(java.lang.String key)
get in interface org.springframework.integration.metadata.MetadataStore@Transactional public java.lang.String remove(java.lang.String key)
remove in interface org.springframework.integration.metadata.MetadataStore