use of io.crnk.meta.model.resource.MetaResourceBase in project crnk-framework by crnk-project.
the class ValidationMetaProviderTest method testNotNullDisablesNullablity.
@Test
public void testNotNullDisablesNullablity() {
setup(true);
MetaResourceBase meta = resourceMetaProvider.getMeta(Task.class);
MetaAttribute attr = meta.getAttribute("name");
Assert.assertFalse(attr.isNullable());
}
use of io.crnk.meta.model.resource.MetaResourceBase in project crnk-framework by crnk-project.
the class JpaMetaEndToEndTest method testProjectedLobOnMappedSuperclass.
@Test
public void testProjectedLobOnMappedSuperclass() {
MetaResourceBase metaResource = resourceMetaProvider.getMeta(AnnotationMappedSubtypeEntity.class);
MetaAttribute lobAttr = metaResource.getAttribute("lobValue");
Assert.assertTrue(lobAttr.isLob());
}
use of io.crnk.meta.model.resource.MetaResourceBase in project crnk-framework by crnk-project.
the class JpaMetaEndToEndTest method testProjectedColumnAnnotatedValueIsNullable.
@Test
public void testProjectedColumnAnnotatedValueIsNullable() {
MetaResourceBase meta = resourceMetaProvider.getMeta(AnnotationTestEntity.class);
MetaAttribute field = meta.getAttribute("nullableValue");
Assert.assertTrue(field.isNullable());
}
use of io.crnk.meta.model.resource.MetaResourceBase in project crnk-framework by crnk-project.
the class JpaMetaEndToEndTest method testAttributeInsertableUpdatable.
@Test
public void testAttributeInsertableUpdatable() {
MetaResource versionMeta = resourceMetaProvider.getMeta(VersionedEntity.class);
MetaAttribute idAttr = versionMeta.getAttribute("id");
MetaAttribute valueAttr = versionMeta.getAttribute("longValue");
Assert.assertTrue(idAttr.isInsertable());
Assert.assertFalse(idAttr.isUpdatable());
Assert.assertTrue(valueAttr.isInsertable());
Assert.assertTrue(valueAttr.isUpdatable());
MetaResourceBase annotationMeta = resourceMetaProvider.getMeta(AnnotationTestEntity.class);
MetaAttribute fieldAnnotatedAttr = annotationMeta.getAttribute("fieldAnnotatedValue");
MetaAttribute columnAnnotatedAttr = annotationMeta.getAttribute("columnAnnotatedValue");
Assert.assertTrue(fieldAnnotatedAttr.isInsertable());
Assert.assertFalse(fieldAnnotatedAttr.isUpdatable());
Assert.assertFalse(fieldAnnotatedAttr.isSortable());
Assert.assertFalse(fieldAnnotatedAttr.isFilterable());
Assert.assertFalse(columnAnnotatedAttr.isInsertable());
Assert.assertTrue(columnAnnotatedAttr.isUpdatable());
Assert.assertTrue(columnAnnotatedAttr.isSortable());
Assert.assertTrue(columnAnnotatedAttr.isFilterable());
MetaAttribute embeddableValueAttr = annotationMeta.getAttribute("embeddableValue");
Assert.assertFalse(embeddableValueAttr.isInsertable());
Assert.assertTrue(embeddableValueAttr.isUpdatable());
Assert.assertTrue(embeddableValueAttr.isSortable());
Assert.assertFalse(embeddableValueAttr.isFilterable());
MetaResourceBase superMeta = resourceMetaProvider.getMeta(AnnotationMappedSubtypeEntity.class);
fieldAnnotatedAttr = superMeta.getAttribute("fieldAnnotatedValue");
columnAnnotatedAttr = superMeta.getAttribute("columnAnnotatedValue");
MetaAttribute lobAttr = superMeta.getAttribute("lobValue");
Assert.assertTrue(fieldAnnotatedAttr.isInsertable());
Assert.assertFalse(fieldAnnotatedAttr.isUpdatable());
Assert.assertFalse(fieldAnnotatedAttr.isSortable());
Assert.assertFalse(fieldAnnotatedAttr.isFilterable());
Assert.assertFalse(columnAnnotatedAttr.isInsertable());
Assert.assertTrue(columnAnnotatedAttr.isUpdatable());
Assert.assertTrue(columnAnnotatedAttr.isSortable());
Assert.assertTrue(columnAnnotatedAttr.isFilterable());
Assert.assertTrue(lobAttr.isInsertable());
Assert.assertTrue(lobAttr.isUpdatable());
Assert.assertFalse(lobAttr.isSortable());
Assert.assertFalse(lobAttr.isFilterable());
}
use of io.crnk.meta.model.resource.MetaResourceBase 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());
}
Aggregations