summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/repo
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon/carbonado/repo')
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java4
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java3
-rw-r--r--src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java3
3 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java
index bcdd0c4..6e7bf2f 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java
@@ -43,6 +43,7 @@ import com.amazon.carbonado.PersistException;
import com.amazon.carbonado.Repository;
import com.amazon.carbonado.RepositoryException;
import com.amazon.carbonado.Transaction;
+import com.amazon.carbonado.TriggerFactory;
import com.amazon.carbonado.UnsupportedTypeException;
import com.amazon.carbonado.capability.Capability;
@@ -135,6 +136,7 @@ public class JDBCRepository
private final String mName;
final boolean mIsMaster;
+ final Iterable<TriggerFactory> mTriggerFactories;
private final AtomicReference<Repository> mRootRef;
private final String mDatabaseProductName;
private final DataSource mDataSource;
@@ -179,6 +181,7 @@ public class JDBCRepository
@SuppressWarnings("unchecked")
JDBCRepository(AtomicReference<Repository> rootRef,
String name, boolean isMaster,
+ Iterable<TriggerFactory> triggerFactories,
DataSource dataSource, String catalog, String schema)
throws RepositoryException
{
@@ -187,6 +190,7 @@ public class JDBCRepository
}
mName = name;
mIsMaster = isMaster;
+ mTriggerFactories = triggerFactories;
mRootRef = rootRef;
mDataSource = dataSource;
mCatalog = catalog;
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java
index 3a797e8..5b59852 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java
@@ -72,7 +72,8 @@ public class JDBCRepositoryBuilder extends AbstractRepositoryBuilder {
public JDBCRepository build(AtomicReference<Repository> rootRef) throws RepositoryException {
assertReady();
JDBCRepository repo = new JDBCRepository
- (rootRef, getName(), isMaster(), getDataSource(), mCatalog, mSchema);
+ (rootRef, getName(), isMaster(), getTriggerFactories(),
+ getDataSource(), mCatalog, mSchema);
rootRef.set(repo);
return repo;
}
diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java
index 5d4a4a2..08cdb46 100644
--- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java
+++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java
@@ -110,7 +110,8 @@ class JDBCStorage<S extends Storable> extends StandardQueryFactory<S>
mExecutorFactory = new QueryExecutorCache<S>(new ExecutorFactory());
- mTriggerManager = new TriggerManager<S>();
+ mTriggerManager = new TriggerManager<S>
+ (info.getStorableType(), repository.mTriggerFactories);
}
public Class<S> getStorableType() {