Search in sources :

Example 1 with DataRowStore

use of org.apache.cayenne.access.DataRowStore in project cayenne by apache.

the class DataContextFactory method createFromGenericChannel.

protected ObjectContext createFromGenericChannel(DataChannel parent) {
    // for new dataRowStores use the same name for all stores
    // it makes it easier to track the event subject
    DataRowStore snapshotCache = (dataDomain.isSharedCacheEnabled()) ? dataDomain.getSharedSnapshotCache() : dataRowStoreFactory.createDataRowStore(dataDomain.getName());
    DataContext context = newInstance(parent, objectStoreFactory.createObjectStore(snapshotCache));
    context.setValidatingObjectsOnCommit(dataDomain.isValidatingObjectsOnCommit());
    context.setQueryCache(new NestedQueryCache(queryCache));
    return context;
}
Also used : DataContext(org.apache.cayenne.access.DataContext) NestedQueryCache(org.apache.cayenne.cache.NestedQueryCache) DataRowStore(org.apache.cayenne.access.DataRowStore)

Example 2 with DataRowStore

use of org.apache.cayenne.access.DataRowStore in project cayenne by apache.

the class DataContextFactory method createdFromDataDomain.

protected ObjectContext createdFromDataDomain(DataDomain parent) {
    // for new dataRowStores use the same name for all stores
    // it makes it easier to track the event subject
    DataRowStore snapshotCache = (parent.isSharedCacheEnabled()) ? parent.getSharedSnapshotCache() : dataRowStoreFactory.createDataRowStore(parent.getName());
    DataContext context = newInstance(parent, objectStoreFactory.createObjectStore(snapshotCache));
    context.setValidatingObjectsOnCommit(parent.isValidatingObjectsOnCommit());
    context.setQueryCache(new NestedQueryCache(queryCache));
    context.setTransactionFactory(transactionFactory);
    return context;
}
Also used : DataContext(org.apache.cayenne.access.DataContext) NestedQueryCache(org.apache.cayenne.cache.NestedQueryCache) DataRowStore(org.apache.cayenne.access.DataRowStore)

Aggregations

DataContext (org.apache.cayenne.access.DataContext)2 DataRowStore (org.apache.cayenne.access.DataRowStore)2 NestedQueryCache (org.apache.cayenne.cache.NestedQueryCache)2