01: package net.sourceforge.jaxor.impl;
02:
03: import net.sourceforge.jaxor.EntityChange;
04: import net.sourceforge.jaxor.api.EntityInterface;
05:
06: import java.sql.PreparedStatement;
07: import java.sql.Connection;
08:
09: /**
10: * Created By: Mike
11: * Date: Feb 12, 2004
12: * Time: 9:43:56 PM
13: *
14: * Last Checkin: $Author: mrettig $
15: * Date: $Date: 2004/02/13 04:48:27 $
16: * Revision: $Revision: 1.1 $
17: */
18: public class UpdateEntityChange extends EntityChange {
19:
20: public UpdateEntityChange(EntityInterface entity) {
21: super (entity);
22: }
23:
24: public UpdateEntityChange(int changeNumber, EntityInterface entity) {
25: super (changeNumber, entity);
26: }
27:
28: public PreparedStatement execute(Connection conn) {
29: getSqlAdapter().update(conn);
30: return null;
31: }
32:
33: public boolean isBatchable() {
34: return false;
35: }
36:
37: public void addToBatch(PreparedStatement stmt) {
38: }
39:
40: public void beforeFlush() {
41: getSqlAdapter().beforeUpdate();
42: }
43:
44: public void flush(Connection conn) {
45: getSqlAdapter().update(conn);
46: }
47:
48: public void afterFlush() {
49: getSqlAdapter().afterUpdate();
50: }
51: }
|