|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IJDBCDialect
This interface provides methods for getting SQL statements for the various tasks a storage implementation must handle, i.e.:
This interface abstracts away the various small SQL syntax differences between database server implementations and enables to re-use the same JDBC-based storage implementation for all JDBC-compatible DBs.
An implementation of a JDBC dialect is typically extremely lightweight as it simply must return a bunch of (usually) static SQL strings.
Important note: Most of the query strings are used in a context where parameter binding is performed; those parameters are in a well-defined order and the query strings should contain the according "?" placeholders. See the query methods documentation for details.
JDBCStorage
,
GenericJDBCDialect
Field Summary |
---|
Fields inherited from interface com.sag.osami.contextstore.storage.DBConstants |
---|
COL_CTXSTORE_ID, COL_DATA, COL_DATA_CLASS, COL_ID, COL_ORIGINID, COL_TIMESTAMP, COL_TYPE, COLS, TABLE_AND_COLS, TABLE_NAME |
Method Summary | |
---|---|
java.lang.String |
createTable()
Returns the SQL statement for creating the context store table. |
java.lang.String |
deleteContextEvent()
Returns the SQL statement for deleting a context event. |
java.lang.String |
driver()
Returns the fully qualified class name of the JDBC driver to be used. |
java.lang.String |
dropTable()
Returns the SQL statement for dropping the context store table. |
java.lang.String |
insertContextEvent()
Returns the SQL statement for inserting a context event. |
java.lang.String |
loadContextEvent()
Returns the SQL statement for loading a context event. |
java.lang.String |
loadContextEvents(int idsCount)
Returns the SQL statement for loading several context events. |
java.lang.String |
queryLastID()
Returns the SQL statement for querying the highest/last ID present in the context store table. |
java.lang.String |
tableExists()
Returns the SQL statement for checking whether the context store table already exists. |
Method Detail |
---|
java.lang.String driver()
java.lang.String queryLastID()
java.lang.String tableExists()
java.lang.String createTable()
Be aware that the ID column should not be auto incremented by the database. ID generation is handled by the ContextStore
.
java.lang.String dropTable()
java.lang.String insertContextEvent()
DBConstants.COLS
.
java.lang.String loadContextEvents(int idsCount) throws java.lang.UnsupportedOperationException
<idCount>
parameters (?) which are bound to the context
event IDs.
This operation is optional. If it is not supported, JDBCStorage
will load the context events individually, querying one context event at a time.
idsCount
- number of the context event IDs to be loaded
java.lang.UnsupportedOperationException
- if the underlying JDBC database does not support loading multiple context events in one queryjava.lang.String loadContextEvent()
java.lang.String deleteContextEvent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |