APISonar


org.rapidoid.http.Resp.json

> org > rapidoid > http > Resp > json
org APIs rapidoid APIs http APIs Resp APIs json APIs

Example 1
public void testLazyEntitiesWithoutTx() {
		JPA.bootstrap(path());
		initData();

		On.get("/movies").json(() -> JPA.of(Movie.class).all());
		On.get("/movies/{id}").json((Long id) -> JPA.get(Movie.class, id));
		On.get("/movie/{id}").serve((Long id, Resp resp) -> resp.json(JPA.get(Movie.class, id)));

		onlyGet("/movies");
		onlyGet("/movies/2");
		onlyGet("/movie/2");
	}