Search in sources :

Example 6 with TestDTO

use of io.crnk.jpa.model.dto.TestDTO in project crnk-framework by crnk-project.

the class TestDTOMapper method map.

@Override
public TestDTO map(Tuple tuple) {
    TestDTO dto = new TestDTO();
    TestEntity entity = tuple.get(0, TestEntity.class);
    dto.setId(entity.getId());
    dto.setStringValue(entity.getStringValue());
    dto.setComputedUpperStringValue(tuple.get("computedUpperStringValue", String.class));
    dto.setComputedNumberOfSmallerIds(tuple.get("computedNumberOfSmallerIds", Long.class));
    return dto;
}
Also used : TestEntity(io.crnk.jpa.model.TestEntity) TestDTO(io.crnk.jpa.model.dto.TestDTO)

Aggregations

TestDTO (io.crnk.jpa.model.dto.TestDTO)6 QuerySpec (io.crnk.core.queryspec.QuerySpec)5 AbstractJpaJerseyTest (io.crnk.jpa.AbstractJpaJerseyTest)5 Serializable (java.io.Serializable)5 Test (org.junit.Test)5 TestEntity (io.crnk.jpa.model.TestEntity)2 RelatedDTO (io.crnk.jpa.model.dto.RelatedDTO)2 FilterSpec (io.crnk.core.queryspec.FilterSpec)1 QTestEntity (io.crnk.jpa.model.QTestEntity)1