@Transactional public static Result delete(Long id) { TodoService.delete(id); return noContent(); }
@Transactional public static Result update(Long id) { TodoItem todo = fromJson(request().body().asJson(), TodoItem.class); TodoItem result = TodoService.update(todo); return ok(toJson(result)); }
@Transactional(readOnly = true) public static Result findOne(Long id) { return ok(toJson(TodoService.findOne(id))); }
@Transactional public static Result create() { TodoItem todo = fromJson(request().body().asJson(), TodoItem.class); TodoItem result = TodoService.create(todo); return created(toJson(result)); }
@Transactional(readOnly = true) public static Result findAll() { return ok(toJson(TodoService.findAll())); }