java.lang.Object
io.helidon.dbclient.DbExecuteBase
- All Implemented Interfaces:
- DbExecute
- Direct Known Subclasses:
- MongoDbExecute
Base 
DbExecute implementation.- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedDbExecuteBase(DbClientContext context) Create an instance of common database executor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected DbClientContextcontext()Return database client context.protected <C extends DbClientContext>
 CReturn database client context cast to it's extending class.createDelete(String statement) Create a delete statement using a statement text.createDmlStatement(String statement) Create a data modification statement using a statement passed as an argument.Create a database query returning a single row using a statement passed as an argument.createInsert(String statement) Create an insert statement using a statement text.createNamedDelete(String statementName) Create a delete statement using a named statement.createNamedDmlStatement(String statementName) Create a data modification statement using a statement defined in the configuration file.createNamedGet(String statementName) Create a database query returning a single row using a statement defined in the configuration file.createNamedInsert(String statementName) Create an insert statement using a named statement.createNamedQuery(String statementName) Create a database query using a statement defined in the configuration file.createNamedUpdate(String statementName) Create an update statement using a named statement.createQuery(String statement) Create a database query using a statement passed as an argument.createUpdate(String statement) Create an update statement using a statement text.protected StringgenerateName(DbStatementType type, String statement) Generate a name for a statement.protected StringstatementText(String name) Return a statement text based on the statement name.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.dbclient.DbExecutecreateNamedDelete, createNamedDmlStatement, createNamedGet, createNamedInsert, createNamedQuery, createNamedUpdate, delete, dml, get, insert, namedDelete, namedDml, namedGet, namedInsert, namedQuery, namedUpdate, query, unwrap, update
- 
Constructor Details- 
DbExecuteBaseCreate an instance of common database executor.- Parameters:
- context- database client context
 
 
- 
- 
Method Details- 
statementTextReturn a statement text based on the statement name. This is a utility method that probably would useDbStatementsto retrieve the named statements.- Parameters:
- name- name of the statement
- Returns:
- statement text
 
- 
contextReturn database client context.- Returns:
- database client context
 
- 
contextReturn database client context cast to it's extending class.- Type Parameters:
- C- client context extending type
- Parameters:
- cls-- DbClientContextextending class
- Returns:
- extended client context
 
- 
createNamedQueryDescription copied from interface:DbExecuteCreate a database query using a statement defined in the configuration file.- Specified by:
- createNamedQueryin interface- DbExecute
- Parameters:
- statementName- the name of the configuration node with statement
- Returns:
- database statement that can process query returning multiple rows
 
- 
createQueryDescription copied from interface:DbExecuteCreate a database query using a statement passed as an argument.- Specified by:
- createQueryin interface- DbExecute
- Parameters:
- statement- the query statement to be executed
- Returns:
- database statement that can process the query returning multiple rows
 
- 
createNamedGetDescription copied from interface:DbExecuteCreate a database query returning a single row using a statement defined in the configuration file.- Specified by:
- createNamedGetin interface- DbExecute
- Parameters:
- statementName- the name of the configuration node with statement
- Returns:
- database statement that can process query returning a single row
 
- 
createGetDescription copied from interface:DbExecuteCreate a database query returning a single row using a statement passed as an argument.
- 
createNamedInsertDescription copied from interface:DbExecuteCreate an insert statement using a named statement.- Specified by:
- createNamedInsertin interface- DbExecute
- Parameters:
- statementName- the name of the statement
- Returns:
- database statement that can insert data
 
- 
createInsertDescription copied from interface:DbExecuteCreate an insert statement using a statement text.- Specified by:
- createInsertin interface- DbExecute
- Parameters:
- statement- the statement text
- Returns:
- database statement that can insert data
 
- 
createNamedUpdateDescription copied from interface:DbExecuteCreate an update statement using a named statement.- Specified by:
- createNamedUpdatein interface- DbExecute
- Parameters:
- statementName- the name of the statement
- Returns:
- database statement that can update data
 
- 
createUpdateDescription copied from interface:DbExecuteCreate an update statement using a statement text.- Specified by:
- createUpdatein interface- DbExecute
- Parameters:
- statement- the statement text
- Returns:
- database statement that can update data
 
- 
createNamedDeleteDescription copied from interface:DbExecuteCreate a delete statement using a named statement.- Specified by:
- createNamedDeletein interface- DbExecute
- Parameters:
- statementName- the name of the statement
- Returns:
- database statement that can delete data
 
- 
createDeleteDescription copied from interface:DbExecuteCreate a delete statement using a statement text.- Specified by:
- createDeletein interface- DbExecute
- Parameters:
- statement- the statement text
- Returns:
- database statement that can delete data
 
- 
createNamedDmlStatementDescription copied from interface:DbExecuteCreate a data modification statement using a statement defined in the configuration file.- Specified by:
- createNamedDmlStatementin interface- DbExecute
- Parameters:
- statementName- the name of the configuration node with statement
- Returns:
- data modification statement
 
- 
createDmlStatementDescription copied from interface:DbExecuteCreate a data modification statement using a statement passed as an argument.- Specified by:
- createDmlStatementin interface- DbExecute
- Parameters:
- statement- the data modification statement to be executed
- Returns:
- data modification statement
 
- 
generateNameGenerate a name for a statement. The default implementation usesSHA-256so the same name is always returned for the same statement.As there is always a small risk of duplicity, named statements are recommended! - Parameters:
- type- type of the statement
- statement- statement that is going to be executed
- Returns:
- name of the statement
 
 
-