use of jetbrains.exodus.entitystore.PersistentStoreTransaction in project xodus by JetBrains.
the class PropertyNotNull method instantiate.
@Override
public Iterable<Entity> instantiate(String entityType, QueryEngine queryEngine, ModelMetaData metaData, InstantiateContext context) {
final EntityMetaData emd = metaData == null ? null : metaData.getEntityMetaData(entityType);
final PropertyMetaData pmd = emd == null ? null : emd.getPropertyMetaData(name);
queryEngine.assertOperational();
final PersistentStoreTransaction txn = queryEngine.getPersistentStore().getAndCheckCurrentTransaction();
return pmd == null || pmd.getType() == PropertyType.PRIMITIVE ? txn.findWithProp(entityType, name) : txn.findWithBlob(entityType, name);
}
use of jetbrains.exodus.entitystore.PersistentStoreTransaction in project xodus by JetBrains.
the class PropertiesTable method deleteNoFail.
public boolean deleteNoFail(@NotNull final PersistentStoreTransaction txn, final long localId, @NotNull final ByteIterable value, int propertyId, @NotNull final ComparableValueType type) {
final ByteIterable key = PropertyKey.propertyKeyToEntry(new PropertyKey(localId, propertyId));
final Transaction envTxn = txn.getEnvironmentTransaction();
final ByteIterable secondaryValue = LongBinding.longToCompressedEntry(localId);
return primaryStore.delete(envTxn, key) && deleteFromStore(envTxn, getOrCreateValueIndex(txn, propertyId), secondaryValue, createSecondaryKeys(store.getPropertyTypes(), value, type)) && deleteFromStore(envTxn, allPropsIndex, secondaryValue, IntegerBinding.intToCompressedEntry(propertyId));
}
use of jetbrains.exodus.entitystore.PersistentStoreTransaction in project xodus by JetBrains.
the class PropertyNotNull method instantiate.
@Override
public Iterable<Entity> instantiate(String entityType, QueryEngine queryEngine, ModelMetaData metaData) {
final EntityMetaData emd = metaData == null ? null : metaData.getEntityMetaData(entityType);
final PropertyMetaData pmd = emd == null ? null : emd.getPropertyMetaData(name);
queryEngine.assertOperational();
final PersistentStoreTransaction txn = queryEngine.getPersistentStore().getAndCheckCurrentTransaction();
return pmd == null || pmd.getType() == PropertyType.PRIMITIVE ? txn.findWithProp(entityType, name) : txn.findWithBlob(entityType, name);
}
use of jetbrains.exodus.entitystore.PersistentStoreTransaction in project xodus by JetBrains.
the class QueryTreeTest method prepare.
private void prepare() {
final PersistentStoreTransaction txn = getStoreTransaction();
Assert.assertNotNull(txn);
final Entity enumeration = e(txn, 1);
t1(txn, enumeration);
t1(txn, enumeration);
t2(txn, e(txn, 2));
propertyEqual = new PropertyEqual("s", "value");
propertyEqualNull = new PropertyEqual("s", null);
propertyNotNull = new PropertyNotNull("s");
linkEqual = new LinkEqual("myEnum", enumeration);
linkEqualNull = new LinkEqual("itself", null);
linkNotNull = new LinkNotNull("itself");
concat = new Concat(propertyEqual, linkNotNull);
}
use of jetbrains.exodus.entitystore.PersistentStoreTransaction in project xodus by JetBrains.
the class PropertiesTable method delete.
public void delete(@NotNull final PersistentStoreTransaction txn, final long localId, @NotNull final ByteIterable value, final int propertyId, @NotNull final ComparableValueType type) {
final ByteIterable key = PropertyKey.propertyKeyToEntry(new PropertyKey(localId, propertyId));
final Transaction envTxn = txn.getEnvironmentTransaction();
final ByteIterable secondaryValue = LongBinding.longToCompressedEntry(localId);
primaryStore.delete(envTxn, key);
deleteFromStore(envTxn, getOrCreateValueIndex(txn, propertyId), secondaryValue, createSecondaryKeys(store.getPropertyTypes(), value, type));
allPropsIndex.remove(envTxn, propertyId, localId);
}
Aggregations