package net.sourceforge.jaxor.impl;
import net.sourceforge.jaxor.EntityChange;
import net.sourceforge.jaxor.api.EntityInterface;
import java.sql.PreparedStatement;
import java.sql.Connection;
import java.sql.SQLException;
/**
* Created By: Mike
* Date: Feb 12, 2004
* Time: 9:45:12 PM
*
* Last Checkin: $Author: mrettig $
* Date: $Date: 2004/03/07 05:06:03 $
* Revision: $Revision: 1.2 $
*/
public class DeleteEntityChange extends EntityChange {
public DeleteEntityChange(EntityInterface entity) {
super(entity);
}
public DeleteEntityChange(int changeNumber, EntityInterface entity) {
super(changeNumber, entity);
}
public PreparedStatement execute(Connection conn) throws SQLException {
return getSqlAdapter().getDeletePreparedStatement(conn);
}
public void beforeFlush(){
getSqlAdapter().beforeDelete();
}
public void flush(Connection conn) {
getSqlAdapter().delete(conn);
}
public void afterFlush() {
getSqlAdapter().afterDelete();
}
public boolean isBatchable() {
return true;
}
public void addToBatch(PreparedStatement stmt) throws SQLException {
getSqlAdapter().addToDeleteBatch(stmt);
stmt.addBatch();
}
}
|