use of io.requery.test.model3.LocationEntity in project requery by requery.
the class JacksonTest method testEmbedSerialize.
@Test
public void testEmbedSerialize() {
LocationEntity t1 = new LocationEntity();
t1.setId(1);
data.insert(t1);
ObjectMapper mapper = new EntityMapper(Models.MODEL3, data);
StringWriter writer = new StringWriter();
try {
mapper.writeValue(writer, t1);
} catch (IOException e) {
throw new RuntimeException(e);
}
String value = writer.toString();
System.out.println(value);
try {
LocationEntity location = mapper.readValue(value, LocationEntity.class);
assertSame(t1, location);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations