use of org.neo4j.ogm.domain.pizza.Pizza in project neo4j-ogm by neo4j.
the class MergeWithPrimaryIndexTests method newNodeUsesGraphIdWhenPrimaryIndexNotPresent.
@Test
public void newNodeUsesGraphIdWhenPrimaryIndexNotPresent() {
Pizza pizza = new Pizza("Plain");
assertThat(pizza.getId()).isNull();
Compiler compiler = mapAndCompile(pizza);
assertThat(compiler.hasStatementsDependentOnNewNodes()).isFalse();
assertThat(compiler.createNodesStatements().get(0).getStatement()).isEqualTo("UNWIND $rows as row CREATE (n:`Pizza`) SET n=row.props RETURN row.nodeRef as ref, ID(n) as id, $type as type");
}
use of org.neo4j.ogm.domain.pizza.Pizza in project neo4j-ogm by neo4j.
the class EntityUtilsTest method shouldCollateStaticAndRuntimeLabels.
@Test
public void shouldCollateStaticAndRuntimeLabels() throws Exception {
Pizza pizza = new Pizza();
List<String> labels = new ArrayList<>();
labels.add("Delicious");
labels.add("Hot");
labels.add("Spicy");
pizza.setLabels(labels);
Collection<String> collatedLabels = EntityUtils.labels(pizza, metaData);
assertThat(collatedLabels).isNotNull();
assertThat(collatedLabels).containsOnly("Delicious", "Hot", "Spicy", "Pizza");
}