コード例 #1
0
  @GET
  @Path("/get/{id}")
  @Produces("application/json")
  @Transactional(propagation = Propagation.REQUIRED)
  public IclubQuoteStatusModel getById(@PathParam("id") Long id) {
    IclubQuoteStatusModel model = new IclubQuoteStatusModel();
    try {
      IclubQuoteStatus bean = iclubQuoteStatusDAO.findById(id);

      model = IclubQuoteStatusTrans.fromORMtoWS(bean);

    } catch (Exception e) {
      LOGGER.error(e, e);
    }
    return model;
  }
コード例 #2
0
  @GET
  @Path("/list")
  @Produces("application/json")
  @Transactional(propagation = Propagation.REQUIRED)
  public <T extends IclubQuoteStatusModel> List<T> list() {
    List<T> ret = new ArrayList<T>();

    try {
      List batmod = iclubQuoteStatusDAO.findAll();
      if (batmod != null && batmod.size() > 0) {
        for (Object object : batmod) {
          IclubQuoteStatus bean = (IclubQuoteStatus) object;

          IclubQuoteStatusModel model = IclubQuoteStatusTrans.fromORMtoWS(bean);

          ret.add((T) model);
        }
      }
    } catch (Exception e) {
      LOGGER.error(e, e);
    }

    return ret;
  }