use of io.crnk.meta.MetaLookup in project crnk-framework by crnk-project.
the class DtoMappingTest method testDtoMeta.
@Test
public void testDtoMeta() {
MetaLookup lookup = metaModule.getLookup();
MetaResource meta = (MetaResource) lookup.getMetaById().get("resources.testDTO");
MetaKey primaryKey = meta.getPrimaryKey();
Assert.assertNotNull(primaryKey);
Assert.assertEquals(1, primaryKey.getElements().size());
Assert.assertEquals("id", primaryKey.getElements().get(0).getName());
MetaAttribute oneRelatedAttr = meta.getAttribute("oneRelatedValue");
Assert.assertTrue(oneRelatedAttr.isAssociation());
}
use of io.crnk.meta.MetaLookup in project crnk-framework by crnk-project.
the class AnyTypeUtilsTest method setup.
@Before
public void setup() {
metaProvider = new JpaMetaProvider(Collections.<Class>emptySet());
MetaLookup lookup = new MetaLookup();
lookup.addProvider(metaProvider);
metaProvider.discoverMeta(TestAnyType.class);
}
use of io.crnk.meta.MetaLookup in project crnk-framework by crnk-project.
the class MetaKeyImplTest method test.
@Test
public void test() {
JpaMetaProvider metaProvider = new JpaMetaProvider((Set) Collections.emptySet());
MetaLookup lookup = new MetaLookup();
lookup.addProvider(metaProvider);
MetaEntity meta = metaProvider.discoverMeta(TestEntity.class);
MetaKey primaryKey = meta.getPrimaryKey();
Assert.assertTrue(primaryKey.isUnique());
Assert.assertEquals("TestEntity$primaryKey", primaryKey.getName());
Assert.assertEquals(1, primaryKey.getElements().size());
}
use of io.crnk.meta.MetaLookup in project crnk-framework by crnk-project.
the class JpaResourceInformationProviderTest method setup.
@Before
public void setup() {
jpaMetaProvider = new JpaMetaProvider(Collections.<Class>emptySet());
lookup = new MetaLookup();
lookup.addProvider(jpaMetaProvider);
builder = new JpaResourceInformationProvider(new NullPropertiesProvider());
builder.init(new DefaultResourceInformationProviderContext(builder, new DefaultInformationBuilder(new TypeParser()), new TypeParser(), new ObjectMapper()));
}
use of io.crnk.meta.MetaLookup in project crnk-framework by crnk-project.
the class JpaNullabilityMetaTest method setup.
@Before
public void setup() {
metaProvider = new JpaMetaProvider(Collections.<Class>emptySet());
MetaLookup lookup = new MetaLookup();
lookup.addProvider(metaProvider);
}
Aggregations