use of org.neo4j.ogm.metadata.FieldInfo in project neo4j-ogm by neo4j.
the class RelationalReaderWriterTest method testUserV5.
// DATAGRAPH-636
@Test
public void testUserV5() {
ClassInfo classInfo = this.domainInfo.getClass(UserV5.class.getName());
UserV5 instance = new UserV5();
UserV5 relatedObject = new UserV5();
assertThat(EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.INCOMING)).isNull();
assertThat(EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.INCOMING, relatedObject)).isNull();
FieldInfo relationalReader = EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.OUTGOING);
FieldInfo relationalWriter = EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.OUTGOING, relatedObject);
relationalWriter.write(instance, relatedObject);
assertThat(instance.getFriend()).isEqualTo(relatedObject);
assertThat(relationalReader.read(instance)).isEqualTo(relatedObject);
}
use of org.neo4j.ogm.metadata.FieldInfo in project neo4j-ogm by neo4j.
the class RelationalReaderWriterTest method testUserV13.
// DATAGRAPH-636
@Test
public void testUserV13() {
ClassInfo classInfo = this.domainInfo.getClass(UserV13.class.getName());
UserV13 instance = new UserV13();
UserV13 relatedObject = new UserV13();
assertThat(EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.INCOMING)).isNull();
assertThat(EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.INCOMING, relatedObject)).isNull();
FieldInfo relationalReader = EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.OUTGOING);
FieldInfo relationalWriter = EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.OUTGOING, relatedObject);
relationalWriter.write(instance, relatedObject);
assertThat(instance.getKnows()).isEqualTo(relatedObject);
assertThat(relationalReader.read(instance)).isEqualTo(relatedObject);
}
use of org.neo4j.ogm.metadata.FieldInfo in project neo4j-ogm by neo4j.
the class RelationalReaderWriterTest method testUserV7.
// DATAGRAPH-636
@Test
public void testUserV7() {
ClassInfo classInfo = this.domainInfo.getClass(UserV7.class.getName());
UserV7 instance = new UserV7();
UserV7 relatedObject = new UserV7();
assertThat(EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.INCOMING)).isNull();
assertThat(EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.INCOMING, relatedObject)).isNull();
FieldInfo relationalReader = EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.OUTGOING);
FieldInfo relationalWriter = EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.OUTGOING, relatedObject);
relationalWriter.write(instance, relatedObject);
assertThat(instance.getKnows()).isEqualTo(relatedObject);
assertThat(relationalReader.read(instance)).isEqualTo(relatedObject);
}
use of org.neo4j.ogm.metadata.FieldInfo in project neo4j-ogm by neo4j.
the class RelationalReaderWriterTest method testUserV10.
// DATAGRAPH-636
@Test
public void testUserV10() {
ClassInfo classInfo = this.domainInfo.getClass(UserV10.class.getName());
UserV10 instance = new UserV10();
UserV10 relatedObjectOut = new UserV10();
UserV10 relatedObjectIn = new UserV10();
FieldInfo relationalReader = EntityAccessManager.getRelationalReader(classInfo, LIKES, Relationship.Direction.OUTGOING);
FieldInfo relationalWriter = EntityAccessManager.getRelationalWriter(classInfo, LIKES, Relationship.Direction.OUTGOING, relatedObjectOut);
relationalWriter.write(instance, relatedObjectOut);
assertThat(instance.getLikes()).isEqualTo(relatedObjectOut);
assertThat(relationalReader.read(instance)).isEqualTo(relatedObjectOut);
relationalReader = EntityAccessManager.getRelationalReader(classInfo, LIKES, Relationship.Direction.INCOMING);
relationalWriter = EntityAccessManager.getRelationalWriter(classInfo, LIKES, Relationship.Direction.INCOMING, relatedObjectIn);
relationalWriter.write(instance, relatedObjectIn);
assertThat(instance.getLikedBy()).isEqualTo(relatedObjectIn);
assertThat(relationalReader.read(instance)).isEqualTo(relatedObjectIn);
}
use of org.neo4j.ogm.metadata.FieldInfo in project neo4j-ogm by neo4j.
the class RelationalReaderWriterTest method testUserV14.
// DATAGRAPH-636
@Test
public void testUserV14() {
ClassInfo classInfo = this.domainInfo.getClass(UserV14.class.getName());
UserV14 instance = new UserV14();
UserV14 relatedObject = new UserV14();
assertThat(EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.INCOMING)).isNull();
assertThat(EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.INCOMING, relatedObject)).isNull();
FieldInfo relationalReader = EntityAccessManager.getRelationalReader(classInfo, KNOWS, Relationship.Direction.OUTGOING);
FieldInfo relationalWriter = EntityAccessManager.getRelationalWriter(classInfo, KNOWS, Relationship.Direction.OUTGOING, relatedObject);
relationalWriter.write(instance, relatedObject);
assertThat(instance.knows).isEqualTo(relatedObject);
assertThat(relationalReader.read(instance)).isEqualTo(relatedObject);
}
Aggregations