コード例 #1
0
  @GET
  @Path("selectAll")
  @Produces(MediaType.APPLICATION_JSON)
  public List<SportsCar> getAllPerson() {
    // TODO
    List<SportsCar> list = sportsCarDao.selectAll();

    return list;
  }
コード例 #2
0
  @GET
  @Path("sample")
  @Produces(MediaType.APPLICATION_JSON)
  public SportsCar getSamplePerson() {

    // TODO
    sportsCar = sportsCarDao.selectById(1);

    System.out.println(
        "Returning sample car: " + sportsCar.getModel() + " " + sportsCar.getOrigin());

    return sportsCar;
  }
コード例 #3
0
  @GET
  @Path("sample/id/{id}")
  @Produces(MediaType.APPLICATION_JSON)
  public SportsCar getSamplePersonByPersonId(@PathParam("id") int id) {

    // TODO
    sportsCar = sportsCarDao.selectById(id);

    System.out.println(
        "Returning sample car: " + sportsCar.getModel() + " " + sportsCar.getOrigin());

    return sportsCar;
  }