Exemplo n.º 1
0
  @POST
  @Produces(MediaType.APPLICATION_JSON)
  public void addEmploye() {
    Employe employe = new Employe();

    employeEjb.addEmploye(employe);
    Reponse("200");
  }
Exemplo n.º 2
0
 @GET
 @Path("/list")
 @Produces(MediaType.APPLICATION_JSON)
 public List<Employe> list() {
   List<Employe> employes = new ArrayList<Employe>();
   // employes.add(new Employe());
   employes = employeEjb.findAll();
   Reponse("200");
   return employes;
 }
Exemplo n.º 3
0
  @GET
  @Path("/{id}")
  @Produces(MediaType.APPLICATION_JSON)
  public Employe findById(@PathParam("id") Integer id) {

    Employe employe = employeEjb.findById(id);
    if (employe != null) {
      Reponse("200");
    } else {
      Reponse("404 Not Found");
    }
    return employe;
  }