01: package com.xoetrope.service.replication.hsqldb;
02:
03: import net.xoetrope.optional.data.sql.DataConnection;
04: import net.xoetrope.xui.XProject;
05:
06: public class XHsqlReplicationEngine extends
07: com.xoetrope.service.XReplicationEngine {
08: /**
09: * Creates a new instance of XHsqlReplicationEngine
10: * @param project the current project.
11: * @param dataConn the DataConnection object to be used.
12: */
13: public XHsqlReplicationEngine(XProject project,
14: DataConnection dataConn) {
15: super (project, dataConn);
16: }
17:
18: protected void tagLocalTable(String tableName) {
19: if (!tableName.startsWith("XSYS"))
20: dataConnection
21: .doUpdate("CREATE TRIGGER "
22: + tableName
23: + "_DeleteTrigger AFTER DELETE ON "
24: + tableName
25: + " FOR EACH ROW CALL \"com.xoetrope.service.replication.hsqldb.XLocalDeletionTrigger\"");
26: }
27:
28: protected void createTimestampTables() {
29: if (dataConnection
30: .doUpdate("CREATE TABLE XSYSLOCALTIMESTAMPS (tableName VARCHAR(64), lastUpdate TIMESTAMP, maxPseudoID INT)") != Integer.MIN_VALUE) {
31: dataConnection
32: .doUpdate("CREATE TABLE XSYSSERVERTIMESTAMPS (tableName VARCHAR(64), lastUpdate TIMESTAMP, lastDelete TIMESTAMP)");
33: dataConnection
34: .doUpdate("CREATE TABLE XSYSLOCALDELETIONS (tableName VARCHAR(64), pseudoId INT, deleteDate TIMESTAMP)");
35: hasTimeStamps = true;
36: }
37: }
38:
39: }
|