Package com.warrantchange.model.impl

Examples of com.warrantchange.model.impl.WarrantModelImpl


    boolean merge) throws SystemException {
    warrant = toUnwrappedModel(warrant);

    boolean isNew = warrant.isNew();

    WarrantModelImpl warrantModelImpl = (WarrantModelImpl)warrant;

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, warrant, merge);

      warrant.setNew(false);
    }
    catch (Exception e) {
      throw processException(e);
    }
    finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !WarrantModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    EntityCacheUtil.putResult(WarrantModelImpl.ENTITY_CACHE_ENABLED,
      WarrantImpl.class, warrant.getPrimaryKey(), warrant);

    if (isNew) {
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_ALL,
        new Object[] { warrant.getStatus() }, warrant);

      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_WARRANTBYAGE,
        new Object[] {
          warrant.getCreateDate(),
         
        warrant.getStatus(),
          Boolean.valueOf(warrant.getExpirationWarningSent())
        }, warrant);

      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_USERID,
        new Object[] { Long.valueOf(warrant.getUserId()) }, warrant);
    }
    else {
      if ((warrantModelImpl.getColumnBitmask() &
          FINDER_PATH_FETCH_BY_ALL.getColumnBitmask()) != 0) {
        Object[] args = new Object[] {
            warrantModelImpl.getOriginalStatus()
          };

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ALL, args);
        FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_ALL, args);

        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_ALL,
          new Object[] { warrant.getStatus() }, warrant);
      }

      if ((warrantModelImpl.getColumnBitmask() &
          FINDER_PATH_FETCH_BY_WARRANTBYAGE.getColumnBitmask()) != 0) {
        Object[] args = new Object[] {
            warrantModelImpl.getOriginalCreateDate(),
           
            warrantModelImpl.getOriginalStatus(),
            Boolean.valueOf(warrantModelImpl.getOriginalExpirationWarningSent())
          };

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_WARRANTBYAGE,
          args);
        FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_WARRANTBYAGE,
          args);

        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_WARRANTBYAGE,
          new Object[] {
            warrant.getCreateDate(),
           
          warrant.getStatus(),
            Boolean.valueOf(warrant.getExpirationWarningSent())
          }, warrant);
      }

      if ((warrantModelImpl.getColumnBitmask() &
          FINDER_PATH_FETCH_BY_USERID.getColumnBitmask()) != 0) {
        Object[] args = new Object[] {
            Long.valueOf(warrantModelImpl.getOriginalUserId())
          };

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_USERID, args);
View Full Code Here

TOP

Related Classes of com.warrantchange.model.impl.WarrantModelImpl

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.