Search in sources :

Example 31 with MetaAttribute

use of io.crnk.meta.model.MetaAttribute in project crnk-framework by crnk-project.

the class JpaMetaEndToEndTest method testProjectedLob.

@Test
public void testProjectedLob() {
    MetaResource metaResource = resourceMetaProvider.getMeta(AnnotationTestEntity.class);
    MetaAttribute lobAttr = metaResource.getAttribute("lobValue");
    Assert.assertTrue(lobAttr.isLob());
}
Also used : MetaResource(io.crnk.meta.model.resource.MetaResource) MetaAttribute(io.crnk.meta.model.MetaAttribute) Test(org.junit.Test) AbstractJpaJerseyTest(io.crnk.jpa.AbstractJpaJerseyTest)

Example 32 with MetaAttribute

use of io.crnk.meta.model.MetaAttribute in project crnk-framework by crnk-project.

the class JpaMetaEndToEndTest method testProjectedColumnAnnotatedValueIsNotNullable.

@Test
public void testProjectedColumnAnnotatedValueIsNotNullable() {
    MetaResourceBase meta = resourceMetaProvider.getMeta(AnnotationTestEntity.class);
    MetaAttribute field = meta.getAttribute("notNullableValue");
    Assert.assertFalse(field.isNullable());
}
Also used : MetaAttribute(io.crnk.meta.model.MetaAttribute) MetaResourceBase(io.crnk.meta.model.resource.MetaResourceBase) Test(org.junit.Test) AbstractJpaJerseyTest(io.crnk.jpa.AbstractJpaJerseyTest)

Example 33 with MetaAttribute

use of io.crnk.meta.model.MetaAttribute in project crnk-framework by crnk-project.

the class JpaMetaEndToEndTest method testCascaded.

@Test
public void testCascaded() {
    MetaResource meta = resourceMetaProvider.getMeta(TestEntity.class);
    MetaAttribute oneRelatedAttr = meta.getAttribute("oneRelatedValue");
    MetaAttribute eagerRelatedAttr = meta.getAttribute("eagerRelatedValue");
    Assert.assertTrue(oneRelatedAttr.isCascaded());
    Assert.assertFalse(eagerRelatedAttr.isCascaded());
}
Also used : MetaResource(io.crnk.meta.model.resource.MetaResource) MetaAttribute(io.crnk.meta.model.MetaAttribute) Test(org.junit.Test) AbstractJpaJerseyTest(io.crnk.jpa.AbstractJpaJerseyTest)

Example 34 with MetaAttribute

use of io.crnk.meta.model.MetaAttribute in project crnk-framework by crnk-project.

the class JpaNullabilityMetaTest method testNonOptionalRelatedValue.

@Test
public void testNonOptionalRelatedValue() {
    MetaEntity meta = metaProvider.discoverMeta(AnnotationTestEntity.class);
    MetaAttribute field = meta.getAttribute("nonOptionalRelatedValue");
    Assert.assertFalse(field.isNullable());
}
Also used : MetaAttribute(io.crnk.meta.model.MetaAttribute) Test(org.junit.Test)

Example 35 with MetaAttribute

use of io.crnk.meta.model.MetaAttribute in project crnk-framework by crnk-project.

the class JpaNullabilityMetaTest method testPrimitiveValueNotNullable.

@Test
public void testPrimitiveValueNotNullable() {
    MetaEntity meta = metaProvider.discoverMeta(TestEntity.class);
    MetaAttribute field = meta.getAttribute("longValue");
    Assert.assertFalse(field.isNullable());
}
Also used : MetaAttribute(io.crnk.meta.model.MetaAttribute) Test(org.junit.Test)

Aggregations

MetaAttribute (io.crnk.meta.model.MetaAttribute)54 Test (org.junit.Test)32 MetaResource (io.crnk.meta.model.resource.MetaResource)16 AbstractJpaJerseyTest (io.crnk.jpa.AbstractJpaJerseyTest)9 MetaDataObject (io.crnk.meta.model.MetaDataObject)7 MetaKey (io.crnk.meta.model.MetaKey)7 MetaResourceBase (io.crnk.meta.model.resource.MetaResourceBase)7 FilterSpec (io.crnk.core.queryspec.FilterSpec)5 MetaType (io.crnk.meta.model.MetaType)5 ResourceField (io.crnk.core.engine.information.resource.ResourceField)4 ResourceInformation (io.crnk.core.engine.information.resource.ResourceInformation)4 QuerySpec (io.crnk.core.queryspec.QuerySpec)4 MetaElement (io.crnk.meta.model.MetaElement)4 EntityManager (javax.persistence.EntityManager)4 Type (java.lang.reflect.Type)3 RegistryEntry (io.crnk.core.engine.registry.RegistryEntry)2 TSField (io.crnk.gen.typescript.model.TSField)2 MetaEntity (io.crnk.jpa.meta.MetaEntity)2 MetaJpaDataObject (io.crnk.jpa.meta.MetaJpaDataObject)2 NamingTestEntity (io.crnk.jpa.model.NamingTestEntity)2