public SoPhongVanBanNoiBo updateImpl(
      com.sgs.portlet.sovanbannoibo.model.SoPhongVanBanNoiBo soPhongVanBanNoiBo, boolean merge)
      throws SystemException {
    Session session = null;

    try {
      session = openSession();

      if (merge) {
        session.merge(soPhongVanBanNoiBo);
      } else {
        if (soPhongVanBanNoiBo.isNew()) {
          session.save(soPhongVanBanNoiBo);
        }
      }

      session.flush();

      soPhongVanBanNoiBo.setNew(false);

      return soPhongVanBanNoiBo;
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);

      FinderCacheUtil.clearCache(SoPhongVanBanNoiBo.class.getName());
    }
  }
  @Override
  public JIRAChangeItem updateImpl(com.liferay.socialcoding.model.JIRAChangeItem jiraChangeItem)
      throws SystemException {
    jiraChangeItem = toUnwrappedModel(jiraChangeItem);

    boolean isNew = jiraChangeItem.isNew();

    JIRAChangeItemModelImpl jiraChangeItemModelImpl = (JIRAChangeItemModelImpl) jiraChangeItem;

    Session session = null;

    try {
      session = openSession();

      if (jiraChangeItem.isNew()) {
        session.save(jiraChangeItem);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !JIRAChangeItemModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((jiraChangeItemModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JIRACHANGEGROUPID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {jiraChangeItemModelImpl.getOriginalJiraChangeGroupId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_JIRACHANGEGROUPID, args);
        FinderCacheUtil.removeResult(
            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JIRACHANGEGROUPID, args);

        args = new Object[] {jiraChangeItemModelImpl.getJiraChangeGroupId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_JIRACHANGEGROUPID, args);
        FinderCacheUtil.removeResult(
            FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_JIRACHANGEGROUPID, args);
      }
    }

    EntityCacheUtil.putResult(
        JIRAChangeItemModelImpl.ENTITY_CACHE_ENABLED,
        JIRAChangeItemImpl.class,
        jiraChangeItem.getPrimaryKey(),
        jiraChangeItem,
        false);

    jiraChangeItem.resetOriginalValues();

    return jiraChangeItem;
  }
  @Override
  public Image updateImpl(com.liferay.portal.model.Image image) throws SystemException {
    image = toUnwrappedModel(image);

    boolean isNew = image.isNew();

    Session session = null;

    try {
      session = openSession();

      if (image.isNew()) {
        session.save(image);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        ImageModelImpl.ENTITY_CACHE_ENABLED, ImageImpl.class, image.getPrimaryKey(), image);

    return image;
  }
  public PmlEdmLevelSend updateImpl(
      com.sgs.portlet.pmllevelsend.model.PmlEdmLevelSend pmlEdmLevelSend, boolean merge)
      throws SystemException {
    Session session = null;

    try {
      session = openSession();

      if (merge) {
        session.merge(pmlEdmLevelSend);
      } else {
        if (pmlEdmLevelSend.isNew()) {
          session.save(pmlEdmLevelSend);
        }
      }

      session.flush();

      pmlEdmLevelSend.setNew(false);

      return pmlEdmLevelSend;
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);

      FinderCacheUtil.clearCache(PmlEdmLevelSend.class.getName());
    }
  }
  @Override
  public Counter updateImpl(com.liferay.counter.model.Counter counter) throws SystemException {
    counter = toUnwrappedModel(counter);

    boolean isNew = counter.isNew();

    Session session = null;

    try {
      session = openSession();

      if (counter.isNew()) {
        session.save(counter);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    EntityCacheUtil.putResult(
        CounterModelImpl.ENTITY_CACHE_ENABLED, CounterImpl.class, counter.getPrimaryKey(), counter);

    return counter;
  }
  @Override
  public ListType updateImpl(ListType listType) {
    listType = toUnwrappedModel(listType);

    boolean isNew = listType.isNew();

    ListTypeModelImpl listTypeModelImpl = (ListTypeModelImpl) listType;

    Session session = null;

    try {
      session = openSession();

      if (listType.isNew()) {
        session.save(listType);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !ListTypeModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((listTypeModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TYPE.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {listTypeModelImpl.getOriginalType()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TYPE, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TYPE, args);

        args = new Object[] {listTypeModelImpl.getType()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TYPE, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TYPE, args);
      }
    }

    EntityCacheUtil.putResult(
        ListTypeModelImpl.ENTITY_CACHE_ENABLED,
        ListTypeImpl.class,
        listType.getPrimaryKey(),
        listType,
        false);

    clearUniqueFindersCache(listType);
    cacheUniqueFindersCache(listType);

    listType.resetOriginalValues();

    return listType;
  }
  @Override
  public Account updateImpl(com.liferay.portal.model.Account account) throws SystemException {
    account = toUnwrappedModel(account);

    boolean isNew = account.isNew();

    Session session = null;

    try {
      session = openSession();

      if (account.isNew()) {
        session.save(account);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    EntityCacheUtil.putResult(
        AccountModelImpl.ENTITY_CACHE_ENABLED, AccountImpl.class, account.getPrimaryKey(), account);

    return account;
  }
  @Override
  public ProjectsEntry updateImpl(com.liferay.so.model.ProjectsEntry projectsEntry)
      throws SystemException {
    projectsEntry = toUnwrappedModel(projectsEntry);

    boolean isNew = projectsEntry.isNew();

    ProjectsEntryModelImpl projectsEntryModelImpl = (ProjectsEntryModelImpl) projectsEntry;

    Session session = null;

    try {
      session = openSession();

      if (projectsEntry.isNew()) {
        session.save(projectsEntry);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !ProjectsEntryModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((projectsEntryModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {projectsEntryModelImpl.getOriginalUserId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID, args);

        args = new Object[] {projectsEntryModelImpl.getUserId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID, args);
      }
    }

    EntityCacheUtil.putResult(
        ProjectsEntryModelImpl.ENTITY_CACHE_ENABLED,
        ProjectsEntryImpl.class,
        projectsEntry.getPrimaryKey(),
        projectsEntry,
        false);

    projectsEntry.resetOriginalValues();

    return projectsEntry;
  }
  @Override
  public ShoppingItemPrice updateImpl(ShoppingItemPrice shoppingItemPrice) {
    shoppingItemPrice = toUnwrappedModel(shoppingItemPrice);

    boolean isNew = shoppingItemPrice.isNew();

    ShoppingItemPriceModelImpl shoppingItemPriceModelImpl =
        (ShoppingItemPriceModelImpl) shoppingItemPrice;

    Session session = null;

    try {
      session = openSession();

      if (shoppingItemPrice.isNew()) {
        session.save(shoppingItemPrice);

        shoppingItemPrice.setNew(false);
      } else {
        shoppingItemPrice = (ShoppingItemPrice) session.merge(shoppingItemPrice);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !ShoppingItemPriceModelImpl.COLUMN_BITMASK_ENABLED) {
      finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((shoppingItemPriceModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {shoppingItemPriceModelImpl.getOriginalItemId()};

        finderCache.removeResult(FINDER_PATH_COUNT_BY_ITEMID, args);
        finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID, args);

        args = new Object[] {shoppingItemPriceModelImpl.getItemId()};

        finderCache.removeResult(FINDER_PATH_COUNT_BY_ITEMID, args);
        finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID, args);
      }
    }

    entityCache.putResult(
        ShoppingItemPriceModelImpl.ENTITY_CACHE_ENABLED,
        ShoppingItemPriceImpl.class,
        shoppingItemPrice.getPrimaryKey(),
        shoppingItemPrice,
        false);

    shoppingItemPrice.resetOriginalValues();

    return shoppingItemPrice;
  }
  @Override
  public UserTrackerPath updateImpl(UserTrackerPath userTrackerPath) {
    userTrackerPath = toUnwrappedModel(userTrackerPath);

    boolean isNew = userTrackerPath.isNew();

    UserTrackerPathModelImpl userTrackerPathModelImpl = (UserTrackerPathModelImpl) userTrackerPath;

    Session session = null;

    try {
      session = openSession();

      if (userTrackerPath.isNew()) {
        session.save(userTrackerPath);

        userTrackerPath.setNew(false);
      } else {
        userTrackerPath = (UserTrackerPath) session.merge(userTrackerPath);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !UserTrackerPathModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((userTrackerPathModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {userTrackerPathModelImpl.getOriginalUserTrackerId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERTRACKERID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID, args);

        args = new Object[] {userTrackerPathModelImpl.getUserTrackerId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERTRACKERID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERTRACKERID, args);
      }
    }

    EntityCacheUtil.putResult(
        UserTrackerPathModelImpl.ENTITY_CACHE_ENABLED,
        UserTrackerPathImpl.class,
        userTrackerPath.getPrimaryKey(),
        userTrackerPath,
        false);

    userTrackerPath.resetOriginalValues();

    return userTrackerPath;
  }
  @Override
  public ShoppingItemField updateImpl(
      com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField)
      throws SystemException {
    shoppingItemField = toUnwrappedModel(shoppingItemField);

    boolean isNew = shoppingItemField.isNew();

    ShoppingItemFieldModelImpl shoppingItemFieldModelImpl =
        (ShoppingItemFieldModelImpl) shoppingItemField;

    Session session = null;

    try {
      session = openSession();

      if (shoppingItemField.isNew()) {
        session.save(shoppingItemField);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !ShoppingItemFieldModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((shoppingItemFieldModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {Long.valueOf(shoppingItemFieldModelImpl.getOriginalItemId())};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ITEMID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID, args);

        args = new Object[] {Long.valueOf(shoppingItemFieldModelImpl.getItemId())};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ITEMID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ITEMID, args);
      }
    }

    EntityCacheUtil.putResult(
        ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
        ShoppingItemFieldImpl.class,
        shoppingItemField.getPrimaryKey(),
        shoppingItemField);

    return shoppingItemField;
  }
  @Override
  public EmpPersonalDetails updateImpl(
      com.rknowsys.eapp.hrm.model.EmpPersonalDetails empPersonalDetails) throws SystemException {
    empPersonalDetails = toUnwrappedModel(empPersonalDetails);

    boolean isNew = empPersonalDetails.isNew();

    EmpPersonalDetailsModelImpl empPersonalDetailsModelImpl =
        (EmpPersonalDetailsModelImpl) empPersonalDetails;

    Session session = null;

    try {
      session = openSession();

      if (empPersonalDetails.isNew()) {
        session.save(empPersonalDetails);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !EmpPersonalDetailsModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((empPersonalDetailsModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMPLOYEEID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {empPersonalDetailsModelImpl.getOriginalEmployeeId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_EMPLOYEEID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMPLOYEEID, args);

        args = new Object[] {empPersonalDetailsModelImpl.getEmployeeId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_EMPLOYEEID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_EMPLOYEEID, args);
      }
    }

    EntityCacheUtil.putResult(
        EmpPersonalDetailsModelImpl.ENTITY_CACHE_ENABLED,
        EmpPersonalDetailsImpl.class,
        empPersonalDetails.getPrimaryKey(),
        empPersonalDetails);

    return empPersonalDetails;
  }
  @Override
  public OrgLabor updateImpl(com.liferay.portal.model.OrgLabor orgLabor) throws SystemException {
    orgLabor = toUnwrappedModel(orgLabor);

    boolean isNew = orgLabor.isNew();

    OrgLaborModelImpl orgLaborModelImpl = (OrgLaborModelImpl) orgLabor;

    Session session = null;

    try {
      session = openSession();

      if (orgLabor.isNew()) {
        session.save(orgLabor);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !OrgLaborModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((orgLaborModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {Long.valueOf(orgLaborModelImpl.getOriginalOrganizationId())};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID, args);

        args = new Object[] {Long.valueOf(orgLaborModelImpl.getOrganizationId())};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_ORGANIZATIONID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_ORGANIZATIONID, args);
      }
    }

    EntityCacheUtil.putResult(
        OrgLaborModelImpl.ENTITY_CACHE_ENABLED,
        OrgLaborImpl.class,
        orgLabor.getPrimaryKey(),
        orgLabor);

    return orgLabor;
  }
  @Override
  public Foo updateImpl(com.liferay.testpacl.model.Foo foo) {
    foo = toUnwrappedModel(foo);

    boolean isNew = foo.isNew();

    FooModelImpl fooModelImpl = (FooModelImpl) foo;

    Session session = null;

    try {
      session = openSession();

      if (foo.isNew()) {
        session.save(foo);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !FooModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((fooModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_FIELD2.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {fooModelImpl.getOriginalField2()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FIELD2, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_FIELD2, args);

        args = new Object[] {fooModelImpl.getField2()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FIELD2, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_FIELD2, args);
      }
    }

    EntityCacheUtil.putResult(
        FooModelImpl.ENTITY_CACHE_ENABLED, FooImpl.class, foo.getPrimaryKey(), foo, false);

    foo.resetOriginalValues();

    return foo;
  }
  @Override
  public Bar updateImpl(com.liferay.testtransaction.model.Bar bar) {
    bar = toUnwrappedModel(bar);

    boolean isNew = bar.isNew();

    BarModelImpl barModelImpl = (BarModelImpl) bar;

    Session session = null;

    try {
      session = openSession();

      if (bar.isNew()) {
        session.save(bar);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !BarModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((barModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TEXT.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {barModelImpl.getOriginalText()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TEXT, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TEXT, args);

        args = new Object[] {barModelImpl.getText()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TEXT, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_TEXT, args);
      }
    }

    EntityCacheUtil.putResult(
        BarModelImpl.ENTITY_CACHE_ENABLED, BarImpl.class, bar.getPrimaryKey(), bar, false);

    bar.resetOriginalValues();

    return bar;
  }
  @Override
  public Task updateImpl(com.rivetlogic.portlet.todo.model.Task task) throws SystemException {
    task = toUnwrappedModel(task);

    boolean isNew = task.isNew();

    TaskModelImpl taskModelImpl = (TaskModelImpl) task;

    Session session = null;

    try {
      session = openSession();

      if (task.isNew()) {
        session.save(task);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !TaskModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((taskModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {taskModelImpl.getOriginalUserId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID, args);

        args = new Object[] {taskModelImpl.getUserId()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_USERID, args);
      }
    }

    EntityCacheUtil.putResult(
        TaskModelImpl.ENTITY_CACHE_ENABLED, TaskImpl.class, task.getPrimaryKey(), task);

    return task;
  }
  @Override
  public DLSyncEvent updateImpl(com.liferay.portlet.documentlibrary.model.DLSyncEvent dlSyncEvent)
      throws SystemException {
    dlSyncEvent = toUnwrappedModel(dlSyncEvent);

    boolean isNew = dlSyncEvent.isNew();

    Session session = null;

    try {
      session = openSession();

      if (dlSyncEvent.isNew()) {
        session.save(dlSyncEvent);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        DLSyncEventModelImpl.ENTITY_CACHE_ENABLED,
        DLSyncEventImpl.class,
        dlSyncEvent.getPrimaryKey(),
        dlSyncEvent,
        false);

    clearUniqueFindersCache(dlSyncEvent);
    cacheUniqueFindersCache(dlSyncEvent);

    dlSyncEvent.resetOriginalValues();

    return dlSyncEvent;
  }
  @Override
  public SVNRepository updateImpl(com.liferay.socialcoding.model.SVNRepository svnRepository) {
    svnRepository = toUnwrappedModel(svnRepository);

    boolean isNew = svnRepository.isNew();

    Session session = null;

    try {
      session = openSession();

      if (svnRepository.isNew()) {
        session.save(svnRepository);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        SVNRepositoryModelImpl.ENTITY_CACHE_ENABLED,
        SVNRepositoryImpl.class,
        svnRepository.getPrimaryKey(),
        svnRepository,
        false);

    clearUniqueFindersCache(svnRepository);
    cacheUniqueFindersCache(svnRepository);

    svnRepository.resetOriginalValues();

    return svnRepository;
  }
  @Override
  public BrowserTracker updateImpl(com.liferay.portal.model.BrowserTracker browserTracker)
      throws SystemException {
    browserTracker = toUnwrappedModel(browserTracker);

    boolean isNew = browserTracker.isNew();

    Session session = null;

    try {
      session = openSession();

      if (browserTracker.isNew()) {
        session.save(browserTracker);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        BrowserTrackerModelImpl.ENTITY_CACHE_ENABLED,
        BrowserTrackerImpl.class,
        browserTracker.getPrimaryKey(),
        browserTracker);

    clearUniqueFindersCache(browserTracker);
    cacheUniqueFindersCache(browserTracker);

    return browserTracker;
  }
  @Override
  public TipsOfTheDayUsers updateImpl(com.rivetlogic.model.TipsOfTheDayUsers tipsOfTheDayUsers)
      throws SystemException {
    tipsOfTheDayUsers = toUnwrappedModel(tipsOfTheDayUsers);

    boolean isNew = tipsOfTheDayUsers.isNew();

    Session session = null;

    try {
      session = openSession();

      if (tipsOfTheDayUsers.isNew()) {
        session.save(tipsOfTheDayUsers);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        TipsOfTheDayUsersModelImpl.ENTITY_CACHE_ENABLED,
        TipsOfTheDayUsersImpl.class,
        tipsOfTheDayUsers.getPrimaryKey(),
        tipsOfTheDayUsers);

    clearUniqueFindersCache(tipsOfTheDayUsers);
    cacheUniqueFindersCache(tipsOfTheDayUsers);

    return tipsOfTheDayUsers;
  }
  @Override
  public Shard updateImpl(com.liferay.portal.model.Shard shard) throws SystemException {
    shard = toUnwrappedModel(shard);

    boolean isNew = shard.isNew();

    Session session = null;

    try {
      session = openSession();

      if (shard.isNew()) {
        session.save(shard);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        ShardModelImpl.ENTITY_CACHE_ENABLED, ShardImpl.class, shard.getPrimaryKey(), shard, false);

    clearUniqueFindersCache(shard);
    cacheUniqueFindersCache(shard);

    shard.resetOriginalValues();

    return shard;
  }
  @Override
  public ProposalRating updateImpl(com.ext.portlet.model.ProposalRating proposalRating)
      throws SystemException {
    proposalRating = toUnwrappedModel(proposalRating);

    boolean isNew = proposalRating.isNew();

    Session session = null;

    try {
      session = openSession();

      if (proposalRating.isNew()) {
        session.save(proposalRating);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    EntityCacheUtil.putResult(
        ProposalRatingModelImpl.ENTITY_CACHE_ENABLED,
        ProposalRatingImpl.class,
        proposalRating.getPrimaryKey(),
        proposalRating);

    return proposalRating;
  }
  @Override
  public Type updateImpl(Type type) {
    type = toUnwrappedModel(type);

    boolean isNew = type.isNew();

    Session session = null;

    try {
      session = openSession();

      if (type.isNew()) {
        session.save(type);

        type.setNew(false);
      } else {
        type = (Type) session.merge(type);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew) {
      finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    entityCache.putResult(
        TypeModelImpl.ENTITY_CACHE_ENABLED, TypeImpl.class, type.getPrimaryKey(), type, false);

    type.resetOriginalValues();

    return type;
  }
  @Override
  public WebDAVProps updateImpl(WebDAVProps webDAVProps) {
    webDAVProps = toUnwrappedModel(webDAVProps);

    boolean isNew = webDAVProps.isNew();

    WebDAVPropsModelImpl webDAVPropsModelImpl = (WebDAVPropsModelImpl) webDAVProps;

    ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();

    Date now = new Date();

    if (isNew && (webDAVProps.getCreateDate() == null)) {
      if (serviceContext == null) {
        webDAVProps.setCreateDate(now);
      } else {
        webDAVProps.setCreateDate(serviceContext.getCreateDate(now));
      }
    }

    if (!webDAVPropsModelImpl.hasSetModifiedDate()) {
      if (serviceContext == null) {
        webDAVProps.setModifiedDate(now);
      } else {
        webDAVProps.setModifiedDate(serviceContext.getModifiedDate(now));
      }
    }

    Session session = null;

    try {
      session = openSession();

      if (webDAVProps.isNew()) {
        session.save(webDAVProps);

        webDAVProps.setNew(false);
      } else {
        webDAVProps = (WebDAVProps) session.merge(webDAVProps);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !WebDAVPropsModelImpl.COLUMN_BITMASK_ENABLED) {
      finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    entityCache.putResult(
        WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
        WebDAVPropsImpl.class,
        webDAVProps.getPrimaryKey(),
        webDAVProps,
        false);

    clearUniqueFindersCache(webDAVPropsModelImpl);
    cacheUniqueFindersCache(webDAVPropsModelImpl, isNew);

    webDAVProps.resetOriginalValues();

    return webDAVProps;
  }
  @Override
  public Semester updateImpl(Semester semester) {
    semester = toUnwrappedModel(semester);

    boolean isNew = semester.isNew();

    SemesterModelImpl semesterModelImpl = (SemesterModelImpl) semester;

    ServiceContext serviceContext = ServiceContextThreadLocal.getServiceContext();

    Date now = new Date();

    if (isNew && (semester.getCreateDate() == null)) {
      if (serviceContext == null) {
        semester.setCreateDate(now);
      } else {
        semester.setCreateDate(serviceContext.getCreateDate(now));
      }
    }

    if (!semesterModelImpl.hasSetModifiedDate()) {
      if (serviceContext == null) {
        semester.setModifiedDate(now);
      } else {
        semester.setModifiedDate(serviceContext.getModifiedDate(now));
      }
    }

    Session session = null;

    try {
      session = openSession();

      if (semester.isNew()) {
        session.save(semester);

        semester.setNew(false);
      } else {
        semester = (Semester) session.merge(semester);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !SemesterModelImpl.COLUMN_BITMASK_ENABLED) {
      finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    }

    entityCache.putResult(
        SemesterModelImpl.ENTITY_CACHE_ENABLED,
        SemesterImpl.class,
        semester.getPrimaryKey(),
        semester,
        false);

    clearUniqueFindersCache(semesterModelImpl);
    cacheUniqueFindersCache(semesterModelImpl, isNew);

    semester.resetOriginalValues();

    return semester;
  }
  @Override
  public PortalPreferences updateImpl(com.liferay.portal.model.PortalPreferences portalPreferences)
      throws SystemException {
    portalPreferences = toUnwrappedModel(portalPreferences);

    boolean isNew = portalPreferences.isNew();

    PortalPreferencesModelImpl portalPreferencesModelImpl =
        (PortalPreferencesModelImpl) portalPreferences;

    Session session = null;

    try {
      session = openSession();

      if (portalPreferences.isNew()) {
        session.save(portalPreferences);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        PortalPreferencesModelImpl.ENTITY_CACHE_ENABLED,
        PortalPreferencesImpl.class,
        portalPreferences.getPrimaryKey(),
        portalPreferences);

    if (isNew) {
      FinderCacheUtil.putResult(
          FINDER_PATH_FETCH_BY_O_O,
          new Object[] {
            Long.valueOf(portalPreferences.getOwnerId()),
            Integer.valueOf(portalPreferences.getOwnerType())
          },
          portalPreferences);
    } else {
      if ((portalPreferencesModelImpl.getColumnBitmask()
              & FINDER_PATH_FETCH_BY_O_O.getColumnBitmask())
          != 0) {
        Object[] args =
            new Object[] {
              Long.valueOf(portalPreferencesModelImpl.getOriginalOwnerId()),
              Integer.valueOf(portalPreferencesModelImpl.getOriginalOwnerType())
            };

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_O_O, args);

        FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_O_O, args);

        FinderCacheUtil.putResult(
            FINDER_PATH_FETCH_BY_O_O,
            new Object[] {
              Long.valueOf(portalPreferences.getOwnerId()),
              Integer.valueOf(portalPreferences.getOwnerType())
            },
            portalPreferences);
      }
    }

    return portalPreferences;
  }