use of io.crnk.jpa.model.FieldOnlyEntity in project crnk-framework by crnk-project.
the class JpaEntityRepositoryTestBase method testFieldOnlyEntity.
@Test
// currently not supported
@Ignore
public void testFieldOnlyEntity() throws InstantiationException, IllegalAccessException {
QuerySpec querySpec = new QuerySpec(FieldOnlyEntity.class);
JpaEntityRepository<FieldOnlyEntity, Long> fieldRepo = new JpaEntityRepository<>(module, JpaRepositoryConfig.create(FieldOnlyEntity.class));
List<FieldOnlyEntity> list = fieldRepo.findAll(querySpec);
Assert.assertEquals(0, list.size());
FieldOnlyEntity entity = new FieldOnlyEntity();
entity.id = 13L;
entity.longValue = 14L;
fieldRepo.create(entity);
FieldOnlyEntity savedEntity = fieldRepo.findOne(13L, querySpec);
Assert.assertNotNull(savedEntity);
Assert.assertEquals(14L, savedEntity.longValue);
fieldRepo.delete(13L);
list = fieldRepo.findAll(querySpec);
Assert.assertEquals(0, list.size());
}
Aggregations