|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sag.osami.contextstore.storage.jdbc.GenericJDBCDialect
public abstract class GenericJDBCDialect
A basic implementation of a JDBC dialect, using only standard SQL.
However, as column type naming and behavior is often very database-specific, this aspect is left to actual dialect implementations. In particular,
IJDBCDialect.createTable()
remains unimplemented, but the convenience method createTable(String[])
is provided.
Naturally, IJDBCDialect.driver()
also remains unimplemented.
JDBCStorage
,
IJDBCDialect
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 |
Constructor Summary | |
---|---|
GenericJDBCDialect()
|
Method Summary | |
---|---|
protected java.lang.String |
createTable(java.lang.String[] colTypes)
Returns a basic CREATE TABLE statement, using the DBConstants.TABLE_AND_COLS list for the table and column names and the colTypes parameter for
the column types. |
java.lang.String |
deleteContextEvent()
Returns the SQL statement for deleting a context event. |
java.lang.String |
dropTable()
Returns the SQL statement for dropping the context store table. |
protected static java.lang.String |
idParams(int idsCount)
Convenience method for generating a (? |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sag.osami.contextstore.storage.jdbc.IJDBCDialect |
---|
createTable, driver |
Constructor Detail |
---|
public GenericJDBCDialect()
Method Detail |
---|
public java.lang.String tableExists()
IJDBCDialect
tableExists
in interface IJDBCDialect
protected java.lang.String createTable(java.lang.String[] colTypes)
DBConstants.TABLE_AND_COLS
list for the table and column names and the colTypes parameter for
the column types.
colTypes
- the data types of the columns. The order within the array should match the one in DBConstants.COLS
public java.lang.String dropTable()
IJDBCDialect
dropTable
in interface IJDBCDialect
public java.lang.String insertContextEvent()
IJDBCDialect
DBConstants.COLS
.
insertContextEvent
in interface IJDBCDialect
public java.lang.String loadContextEvent()
IJDBCDialect
loadContextEvent
in interface IJDBCDialect
public java.lang.String deleteContextEvent()
IJDBCDialect
deleteContextEvent
in interface IJDBCDialect
public java.lang.String loadContextEvents(int idsCount) throws java.lang.UnsupportedOperationException
IJDBCDialect
<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.
loadContextEvents
in interface IJDBCDialect
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 querypublic java.lang.String queryLastID()
IJDBCDialect
queryLastID
in interface IJDBCDialect
protected static java.lang.String idParams(int idsCount)
loadContextEvents(int)
idsCount
- count of the parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |