Package org.synchronoss.cpo.core
Class CpoStatementFactory
java.lang.Object
org.synchronoss.cpo.core.CpoStatementFactory
- All Implemented Interfaces:
CpoReleasable
- Direct Known Subclasses:
CassandraBoundStatementFactory,JdbcPreparedStatementFactory
CpoStatementFactory is the base class that encapsulates the creation of the native statement for
the target datastore from the meta expression, where clauses, and order-by clauses.
- Author:
- david berry
-
Constructor Summary
ConstructorsConstructorDescriptionCpoStatementFactory(org.slf4j.Logger localLogger) Constructs a statement factory that logs to the given logger. -
Method Summary
Modifier and TypeMethodDescriptionvoidAddReleasable(CpoReleasable releasable) Adds a releasable object to this object.getBindValues(CpoFunction function, Object obj) Called by the CPO Framework.org.slf4j.LoggerGets the logger used for statement-building diagnostics.voidrelease()Called by the CPO framework.voidsetBindValues(Collection<BindAttribute> bindValues) Called by the CPO Framework.
-
Constructor Details
-
CpoStatementFactory
public CpoStatementFactory(org.slf4j.Logger localLogger) Constructs a statement factory that logs to the given logger.- Parameters:
localLogger- the logger to use for statement-building diagnostics
-
-
Method Details
-
getLocalLogger
public org.slf4j.Logger getLocalLogger()Gets the logger used for statement-building diagnostics.- Returns:
- the logger used for statement-building diagnostics
-
AddReleasable
Adds a releasable object to this object. The release method on the releasable will be called when the PreparedStatement is executed.- Parameters:
releasable- the releasable to register; ifnullthe call is a no-op
-
release
Called by the CPO framework. This method calls thereleaseon all the CpoReleasable associated with this object- Specified by:
releasein interfaceCpoReleasable- Throws:
CpoException- An exception occurred
-
getBindValues
Called by the CPO Framework. Binds all the attibutes from the class for the CPO meta parameters and the parameters from the dynamic where.- Parameters:
function- the meta function whose arguments describe the parameters to bindobj- the bean instance to pull argument attribute values from- Returns:
- the ordered list of bind values for
function's arguments - Throws:
CpoException- if one offunction's arguments isnull
-
setBindValues
Called by the CPO Framework. Binds all the attibutes from the class for the CPO meta parameters and the parameters from the dynamic where.- Parameters:
bindValues- the bind values to apply to the underlying statement, in parameter order; ifnullthe call is a no-op- Throws:
CpoException- if a value could not be bound to the underlying statement
-