Class DmlHandler
- java.lang.Object
-
- io.ebeaninternal.server.persist.dml.DmlHandler
-
- All Implemented Interfaces:
BindableRequest
- Direct Known Subclasses:
DeleteHandler
,InsertHandler
,UpdateHandler
public abstract class DmlHandler extends Object implements BindableRequest
Base class for Handler implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addBatch()
Add this for batch execution.abstract void
bind()
Get the sql and bind the statement.void
bind(Object value, int sqlType)
Bind a raw value.void
bind(Object value, BeanProperty prop)
Bind the value to the preparedStatement.void
bindNoLog(Object value, int sqlType, String logPlaceHolder)
Bind a raw value with a placeHolder to put into the transaction log.void
bindNoLog(Object value, BeanProperty prop)
Bind the value to the preparedStatement without logging.void
close()
Close the underlying statement.abstract int
execute()
Execute now for non-batch execution.int
executeNoBatch()
PersistRequestBean<?>
getPersistRequest()
Return the original PersistRequest.long
now()
Return the system current time in millis.void
setIdValue(Object idValue)
Set the Id value that was bound.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ebeaninternal.server.persist.dmlbind.BindableRequest
isUpdate
-
-
-
-
Method Detail
-
now
public long now()
Description copied from interface:BindableRequest
Return the system current time in millis. This is expected to the same time used by multiple generated properties for a single request.- Specified by:
now
in interfaceBindableRequest
-
getPersistRequest
public PersistRequestBean<?> getPersistRequest()
Description copied from interface:BindableRequest
Return the original PersistRequest.- Specified by:
getPersistRequest
in interfaceBindableRequest
-
bind
public abstract void bind() throws SQLException
Get the sql and bind the statement.- Throws:
SQLException
-
execute
public abstract int execute() throws SQLException
Execute now for non-batch execution.- Throws:
SQLException
-
executeNoBatch
public final int executeNoBatch() throws SQLException
- Throws:
SQLException
-
addBatch
public void addBatch() throws SQLException
Add this for batch execution.- Throws:
SQLException
-
close
public void close()
Close the underlying statement.
-
setIdValue
public void setIdValue(Object idValue)
Set the Id value that was bound. This value is used for logging summary level information.- Specified by:
setIdValue
in interfaceBindableRequest
-
bind
public void bind(Object value, int sqlType) throws SQLException
Bind a raw value. Used to bind the discriminator column.- Specified by:
bind
in interfaceBindableRequest
- Throws:
SQLException
-
bindNoLog
public void bindNoLog(Object value, int sqlType, String logPlaceHolder) throws SQLException
Description copied from interface:BindableRequest
Bind a raw value with a placeHolder to put into the transaction log.- Specified by:
bindNoLog
in interfaceBindableRequest
- Throws:
SQLException
-
bind
public void bind(Object value, BeanProperty prop) throws SQLException
Bind the value to the preparedStatement.- Specified by:
bind
in interfaceBindableRequest
- Throws:
SQLException
-
bindNoLog
public void bindNoLog(Object value, BeanProperty prop) throws SQLException
Bind the value to the preparedStatement without logging.- Specified by:
bindNoLog
in interfaceBindableRequest
- Throws:
SQLException
-
-