use of jetbrains.exodus.entitystore.Entity in project xodus by JetBrains.
the class ProcessRunner method step.
private void step() throws Exception {
Entity entity = txn.newEntity("Person");
entity.setProperty("name", "Vadim");
entity.setProperty("password", "dummypassword");
byte[] blob = new byte[1024 * 1024];
Arrays.fill(blob, (byte) 1);
entity.setBlob("weight", new ByteArrayInputStream(blob));
txn.flush();
// txn.flush() can skip writing to file, manual flush is required
((EnvironmentImpl) store.getEnvironment()).flushAndSync();
}
use of jetbrains.exodus.entitystore.Entity in project xodus by JetBrains.
the class QueryTreeTest method prepare.
private void prepare() {
final PersistentStoreTransaction txn = getStoreTransaction();
final Entity enumeration = e(txn, 1);
t1(txn, enumeration);
t1(txn, enumeration);
t2(txn, e(txn, 2), "value", 9);
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.Entity in project xodus by JetBrains.
the class QueryTreeTest method t2.
private Entity t2(PersistentStoreTransaction txn, Entity enumeration, String s, int v) {
final Entity e = t1(txn, enumeration);
e.setProperty("s", s);
e.setProperty("i", v);
return e;
}
use of jetbrains.exodus.entitystore.Entity in project xodus by JetBrains.
the class QueryTreeTest method e.
private Entity e(PersistentStoreTransaction txn, int number) {
final Entity result = txn.newEntity("MyEnum");
result.setProperty("number", number);
return result;
}
use of jetbrains.exodus.entitystore.Entity in project xodus by JetBrains.
the class QueryTreeTest method testGenericSort.
public void testGenericSort() throws Exception {
ComparableGetterSort sortNode = new ComparableGetterSort(concat, new ComparableGetter() {
@Override
public Comparable select(Entity entity) {
return entity.getProperty("i");
}
}, true);
Assert.assertEquals(sortNode, sortNode.getClone());
Assert.assertEquals(4, QueryUtil.getSize(instantiate(sortNode)));
Assert.assertEquals(4, QueryUtil.getSize(instantiate(new And(sortNode, NodeFactory.all()))));
Assert.assertFalse(sortNode.equals(propertyEqual));
Assert.assertFalse(propertyEqual.equals(sortNode));
}
Aggregations