1 8 9 package com.sleepycat.je; 10 11 import com.sleepycat.je.txn.Locker; 12 13 class ForeignKeyTrigger implements DatabaseTrigger { 14 15 private SecondaryDatabase secDb; 16 17 ForeignKeyTrigger(SecondaryDatabase secDb) { 18 19 this.secDb = secDb; 20 } 21 22 public void triggerAdded(Database db) { 23 } 24 25 public void triggerRemoved(Database db) { 26 27 secDb.clearForeignKeyTrigger(); 28 } 29 30 public void databaseUpdated(Database db, 31 Locker locker, 32 DatabaseEntry priKey, 33 DatabaseEntry oldData, 34 DatabaseEntry newData) 35 throws DatabaseException { 36 37 if (newData == null) { 38 secDb.onForeignKeyDelete(locker, priKey); 39 } 40 } 41 } 42 | Popular Tags |