Example #1
0
  @SuppressWarnings("unchecked")
  @Override
  public DemoMobileBaseBO find(String comparateId, Class<? extends DemoMobileBaseBO> calsz)
      throws Exception {
    QewebDetachedCriteria detachedCriteria =
        (QewebDetachedCriteria) QewebDetachedCriteria.forClass(calsz);
    detachedCriteria.add(Restrictions.eq("comparateId", comparateId));

    List<DemoMobileBaseBO> result = findByCriteria(detachedCriteria);

    return ContainerUtil.isNull(result) ? calsz.newInstance() : result.get(0);
  }
Example #2
0
  @SuppressWarnings("unchecked")
  @Override
  public DemoMobileBaseBO findSaveInfo(
      long shopId, long vistorId, Class<? extends DemoMobileBaseBO> calsz) throws Exception {
    QewebDetachedCriteria detachedCriteria =
        (QewebDetachedCriteria) QewebDetachedCriteria.forClass(calsz);
    detachedCriteria.add(Restrictions.eq("submitFlag", StringUtils.convertToInt(SubmitBOP.NO)));
    detachedCriteria.add(Restrictions.eq(IBaseDao.FIELD_DELETEFLAG, IBaseDao.UNDELETE_SIGNE));
    detachedCriteria.add(Restrictions.eq("shopBO.id", shopId));
    detachedCriteria.add(Restrictions.eq("visitor.id", vistorId));

    List<DemoMobileBaseBO> result = findByCriteria(detachedCriteria);

    return ContainerUtil.isNull(result) ? calsz.newInstance() : result.get(0);
  }