Package com.warrantchange.model

Examples of com.warrantchange.model.Warrant


   * Never reference this interface directly. Always use {@link com.warrantchange.service.WarrantLocalServiceUtil} to access the Warrant local service.
   */
 
  public Warrant addWarrant(long userId, String summary, int quantity, double price) throws SystemException {
    long id = counterLocalService.increment();
    Warrant warrant = WarrantLocalServiceUtil.createWarrant(id);
    Date now = new Date();
    warrant.setUserId(userId);
    warrant.setSummary(summary);
    warrant.setQuantity(quantity);
    warrant.setPrice(price);
    warrant.setStatus(WarrantStateType.CREATED.name());
    warrant.setCreateDate(now);
    warrant.setModifiedDate(now);
    return WarrantUtil.update(warrant, true);
  }
View Full Code Here


    warrant.setModifiedDate(now);
    return WarrantUtil.update(warrant, true);
  }
 
  public void updateWarrant(long id, String summary, int quantity, double price) throws NoSuchWarrantException, SystemException {
    Warrant warrant = WarrantUtil.findByPrimaryKey(id);
    warrant.setSummary(summary);
    warrant.setQuantity(quantity);
    warrant.setPrice(price);
    warrant.setModifiedDate(new Date());
    updateWarrant(warrant);
  }
View Full Code Here

      WarrantUtil.remove(warrant.getId());
    }
  }
 
  public void deleteWarrant(long id) throws NoSuchWarrantException, SystemException {
    Warrant warrant = WarrantUtil.findByPrimaryKey(id);
    deleteWarrant(warrant);
  }
View Full Code Here

    return DynamicQueryFactoryUtil.forClass(Warrant.class);
  }
 
  public boolean userHasWarrant(long userId) throws SystemException {
    try {
      Warrant findByUserId = WarrantUtil.findByUserId(userId);
      if(findByUserId != null &&
          !findByUserId.getStatus().equals(WarrantStateType.DELETED.name())){
        return true;
      }
    } catch (NoSuchWarrantException e) {
     
    }
View Full Code Here

   *
   * @param id the primary key for the new Warrant
   * @return the new Warrant
   */
  public Warrant create(long id) {
    Warrant warrant = new WarrantImpl();

    warrant.setNew(true);
    warrant.setPrimaryKey(id);

    return warrant;
  }
View Full Code Here

    Session session = null;

    try {
      session = openSession();

      Warrant warrant = (Warrant)session.get(WarrantImpl.class, primaryKey);

      if (warrant == null) {
        if (_log.isWarnEnabled()) {
          _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
        }
View Full Code Here

   * @throws com.warrantchange.NoSuchWarrantException if a Warrant with the primary key could not be found
   * @throws SystemException if a system exception occurred
   */
  public Warrant findByPrimaryKey(long id)
    throws NoSuchWarrantException, SystemException {
    Warrant warrant = fetchByPrimaryKey(id);

    if (warrant == null) {
      if (_log.isWarnEnabled()) {
        _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + id);
      }
View Full Code Here

   * @param id the primary key of the Warrant
   * @return the Warrant, or <code>null</code> if a Warrant with the primary key could not be found
   * @throws SystemException if a system exception occurred
   */
  public Warrant fetchByPrimaryKey(long id) throws SystemException {
    Warrant warrant = (Warrant)EntityCacheUtil.getResult(WarrantModelImpl.ENTITY_CACHE_ENABLED,
        WarrantImpl.class, id);

    if (warrant == _nullWarrant) {
      return null;
    }
View Full Code Here

   * @throws com.warrantchange.NoSuchWarrantException if a matching Warrant could not be found
   * @throws SystemException if a system exception occurred
   */
  public Warrant findByAll(String status)
    throws NoSuchWarrantException, SystemException {
    Warrant warrant = fetchByAll(status);

    if (warrant == null) {
      StringBundler msg = new StringBundler(4);

      msg.append(_NO_SUCH_ENTITY_WITH_KEY);
View Full Code Here

        List<Warrant> list = q.list();

        result = list;

        Warrant warrant = null;

        if (list.isEmpty()) {
          FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_ALL,
            finderArgs, list);
        }
        else {
          warrant = list.get(0);

          cacheResult(warrant);

          if ((warrant.getStatus() == null) ||
              !warrant.getStatus().equals(status)) {
            FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_ALL,
              finderArgs, warrant);
          }
        }
View Full Code Here

TOP

Related Classes of com.warrantchange.model.Warrant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.