- All Implemented Interfaces:
- Serializable,- Binding<T,- U> 
The simplification is provided by offering empty implementations for rarely used methods, such as those for stored procedure OUT parameter support:
- register(BindingRegisterContext)to register the OUT parameter.
- get(BindingGetStatementContext)to read the OUT parameter.
 or SQLData serialisation support (e.g. for Oracle user defined types):
 
- set(BindingSetSQLOutputContext)to serialise a user defined type.
- get(BindingGetSQLInputContext)to read a user defined type.
- Author:
- Lukas Eder
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidget(BindingGetSQLInputContext<U> ctx) Get aSQLInput'sOUTvalue.voidget(BindingGetStatementContext<U> ctx) Get aCallableStatement'sOUTvalue.voidregister(BindingRegisterContext<U> ctx) Register aCallableStatement'sOUTparameter.voidset(BindingSetSQLOutputContext<U> ctx) Set aSQLOutput'sINparameter.voidsql(BindingSQLContext<U> ctx) A convenient base implementation that handles theParamTypesetting and delegates tosqlInline(BindingSQLContext)orsqlBind(BindingSQLContext)respectively.protected voidsqlBind(BindingSQLContext<U> ctx) Generate the SQL string for a bind variable placeholder.protected voidsqlInline(BindingSQLContext<U> ctx) Generate the SQL string for inline values.
- 
Constructor Details- 
AbstractBindingpublic AbstractBinding()
 
- 
- 
Method Details- 
sqlA convenient base implementation that handles theParamTypesetting and delegates tosqlInline(BindingSQLContext)orsqlBind(BindingSQLContext)respectively.- Specified by:
- sqlin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
sqlInlineGenerate the SQL string for inline values.The default implementation generates a string literal representation of the user defined value. Custom implementations may want to override this. - Throws:
- SQLException
 
- 
sqlBindGenerate the SQL string for a bind variable placeholder.In almost all cases, this can just be a "?" string. In some cases, the placeholder needs to be cast to a vendor specific data type, such as in PostgreSQL, "?::tsvector". - Throws:
- SQLException
 
- 
registerDescription copied from interface:BindingRegister aCallableStatement'sOUTparameter.- Specified by:
- registerin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
getDescription copied from interface:BindingGet aCallableStatement'sOUTvalue.Implementations are expected to produce a value by calling BindingGetStatementContext.value(Object), passing the resulting value to the method.- Specified by:
- getin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
setDescription copied from interface:BindingSet aSQLOutput'sINparameter.- Specified by:
- setin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
- 
getDescription copied from interface:BindingGet aSQLInput'sOUTvalue.Implementations are expected to produce a value by calling BindingGetSQLInputContext.value(Object), passing the resulting value to the method.- Specified by:
- getin interface- Binding<T,- U> 
- Parameters:
- ctx- The context object containing all argument objects.
- Throws:
- SQLException- Implementations are allowed to pass on all- SQLExceptions to the caller to be wrapped in- DataAccessExceptions.
 
 
-