Example #1
0
  @POST
  @Path("upsert/{databaseName}")
  public String upsertHectare(
      @PathParam("databaseName") String databaseName, WebServiceHectare webServiceHectare) {

    WSHectare hectareComeFromService = new WSHectare();
    hectareComeFromService =
        (WSHectare) ObjectConverter.convertWebObjectToNormalObject(webServiceHectare);

    String result = hectareService.upsert(databaseName, hectareComeFromService);

    return result;
  }
Example #2
0
  @GET
  @Path("upsert/{databaseName}/{id}/{nodeId}/{parcelId}/{status}/{transactionTime}")
  public String upsertHectare(
      @PathParam("databaseName") String databaseName,
      @PathParam("id") int id,
      @PathParam("nodeId") int nodeId,
      @PathParam("parcelId") int parcelId,
      @PathParam("status") int status,
      @PathParam("transactionTime") String transactionTime)
      throws ParseException {

    WSHectare hectareFromService = new WSHectare();
    hectareFromService.setId(id);
    hectareFromService.setNodeId(nodeId);
    hectareFromService.setParcelId(parcelId);
    hectareFromService.setStatus(status);
    hectareFromService.setTransactionTime(DateConverter.stringToDate(transactionTime));

    hectareService.upsert(databaseName, hectareFromService);

    return "success";
  }