本文整理汇总了Java中com.buschmais.xo.spi.datastore.DatastoreTransaction类的典型用法代码示例。如果您正苦于以下问题:Java DatastoreTransaction类的具体用法?Java DatastoreTransaction怎么用?Java DatastoreTransaction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatastoreTransaction类属于com.buschmais.xo.spi.datastore包,在下文中一共展示了DatastoreTransaction类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.buschmais.xo.spi.datastore.DatastoreTransaction; //导入依赖的package包/类
@Override
public void init(Map<Class<?>, TypeMetadata> registeredMetadata) {
try (DS session = createSession()) {
DatastoreTransaction transaction = session.getDatastoreTransaction();
transaction.begin();
try {
for (TypeMetadata typeMetadata : registeredMetadata.values()) {
if (typeMetadata instanceof EntityTypeMetadata) {
EntityTypeMetadata<NodeMetadata<L>> entityTypeMetadata = (EntityTypeMetadata<NodeMetadata<L>>) typeMetadata;
// check for indexed property declared in type
ensureIndex(session, entityTypeMetadata, entityTypeMetadata.getIndexedProperty());
ensureIndex(session, entityTypeMetadata, entityTypeMetadata.getDatastoreMetadata().getUsingIndexedPropertyOf());
}
}
} finally {
transaction.commit();
}
}
}
示例2: SessionContext
import com.buschmais.xo.spi.datastore.DatastoreTransaction; //导入依赖的package包/类
public SessionContext(MetadataProvider<EntityMetadata, EntityDiscriminator, RelationMetadata, RelationDiscriminator> metadataProvider, PluginRepositoryManager pluginRepositoryManager, DatastoreSession<EntityId, Entity, EntityMetadata, EntityDiscriminator, RelationId, Relation, RelationMetadata, RelationDiscriminator, PropertyMetadata> datastoreSession, ValidatorFactory validatorFactory, List<? extends Class<?>> instanceListenerTypes, TransactionAttribute defaultTransactionAttribute, ValidationMode validationMode, ConcurrencyMode concurrencyMode, ClassLoader classLoader) {
this.metadataProvider = metadataProvider;
this.pluginRepositoryManager = pluginRepositoryManager;
this.datastoreSession = datastoreSession;
this.entityCache = new TransactionalCache<>();
this.relationCache = new TransactionalCache<>();
DatastoreTransaction datastoreTransaction = datastoreSession.getDatastoreTransaction();
this.xoTransaction = datastoreTransaction != null ? new XOTransactionImpl(datastoreTransaction) : null;
List<XOInterceptor> interceptorChain = new ArrayList<>();
interceptorChain.add(new ConcurrencyInterceptor(concurrencyMode));
interceptorChain.add(new TransactionInterceptor(xoTransaction, defaultTransactionAttribute));
this.interceptorFactory = new InterceptorFactory(interceptorChain);
this.proxyFactory = new ProxyFactory(interceptorFactory, classLoader);
this.instanceListenerService = new InstanceListenerService(instanceListenerTypes);
this.entityPropertyManager = new EntityPropertyManager<>(this);
this.relationPropertyManager = new RelationPropertyManager<>(this);
this.relationInstanceManager = new RelationInstanceManager<>(this);
this.entityInstanceManager = new EntityInstanceManager<>(this);
this.instanceValidationService = new InstanceValidationService(validatorFactory, relationCache, entityCache);
this.cacheSynchronizationService = new CacheSynchronizationService<>(this, validationMode);
if (xoTransaction != null) {
// Register default synchronizations.
xoTransaction.registerDefaultSynchronization(new CacheSynchronization<>(cacheSynchronizationService, entityCache, relationCache));
}
}
示例3: getDatastoreTransaction
import com.buschmais.xo.spi.datastore.DatastoreTransaction; //导入依赖的package包/类
@Override
public DatastoreTransaction getDatastoreTransaction() {
return transaction;
}
示例4: getDatastoreTransaction
import com.buschmais.xo.spi.datastore.DatastoreTransaction; //导入依赖的package包/类
@Override
public DatastoreTransaction getDatastoreTransaction() {
return datastoreTransaction;
}
示例5: getDatastoreTransaction
import com.buschmais.xo.spi.datastore.DatastoreTransaction; //导入依赖的package包/类
@Override
public DatastoreTransaction getDatastoreTransaction() {
return transaction;
}
示例6: XOTransactionImpl
import com.buschmais.xo.spi.datastore.DatastoreTransaction; //导入依赖的package包/类
public XOTransactionImpl(DatastoreTransaction datastoreTransaction) {
this.datastoreTransaction = datastoreTransaction;
}
示例7: TraceTransaction
import com.buschmais.xo.spi.datastore.DatastoreTransaction; //导入依赖的package包/类
public TraceTransaction(DatastoreTransaction delegate) {
this.delegate = delegate;
}