use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class EntityFactoryTest method setUp.
@Before
public void setUp() {
MetaData metadata = new MetaData("org.neo4j.ogm.domain.social", "org.neo4j.ogm.domain.canonical");
this.entityFactory = new EntityFactory(metadata, new ReflectionEntityInstantiator(metadata));
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class EntityGraphMapperTest method setUpTestDatabase.
@BeforeClass
public static void setUpTestDatabase() {
mappingMetadata = new MetaData("org.neo4j.ogm.domain.education", "org.neo4j.ogm.domain.forum", "org.neo4j.ogm.domain.social", "org.neo4j.ogm.domain.policy");
mappingContext = new MappingContext(mappingMetadata);
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class LabelDeterminationTest method metaDataWithExplicitPackagesShouldWork.
// GH-619
@Test
public void metaDataWithExplicitPackagesShouldWork() {
MetaData metaData = new MetaData("org.neo4j.ogm.domain.gh619.base", "org.neo4j.ogm.domain.gh619.model");
Collection<String> labels = EntityUtils.labels(new RealNode(), metaData);
assertThat(labels).hasSize(1).containsExactly("real");
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class NumberConversionTest method assertHasCompositeConverter.
@Test
public void assertHasCompositeConverter() {
MetaData restaurantMetadata = new MetaData("org.neo4j.ogm.domain.restaurant");
ClassInfo restaurantInfo = restaurantMetadata.classInfo("Restaurant");
assertThat(restaurantInfo.propertyField("location").hasCompositeConverter()).isTrue();
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class SingleUseEntityMapperTest method shouldLookupCorrectRootClass.
// GH-552
@Test
public void shouldLookupCorrectRootClass() {
MetaData metaData = new MetaData("org.neo4j.ogm.domain.gh552");
String propertyKey = "notAName";
Map<String, Object> properties = Collections.singletonMap(propertyKey, "NOT A NAME!!!");
SingleUseEntityMapper entityMapper = new SingleUseEntityMapper(metaData, new ReflectionEntityInstantiator(metaData));
Thing thing = entityMapper.map(Thing.class, properties);
assertThat(thing.getNotAName()).isEqualTo(properties.get(propertyKey));
}
Aggregations