コード例 #1
0
  protected void cacheUniqueFindersCache(Shard shard) {
    if (shard.isNew()) {
      Object[] args = new Object[] {shard.getName()};

      FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_NAME, args, Long.valueOf(1));
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_NAME, args, shard);

      args = new Object[] {shard.getClassNameId(), shard.getClassPK()};

      FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, args, Long.valueOf(1));
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C, args, shard);
    } else {
      ShardModelImpl shardModelImpl = (ShardModelImpl) shard;

      if ((shardModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_NAME.getColumnBitmask()) != 0) {
        Object[] args = new Object[] {shard.getName()};

        FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_NAME, args, Long.valueOf(1));
        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_NAME, args, shard);
      }

      if ((shardModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_C_C.getColumnBitmask()) != 0) {
        Object[] args = new Object[] {shard.getClassNameId(), shard.getClassPK()};

        FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, args, Long.valueOf(1));
        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C, args, shard);
      }
    }
  }
コード例 #2
0
  protected void clearUniqueFindersCache(Shard shard) {
    ShardModelImpl shardModelImpl = (ShardModelImpl) shard;

    Object[] args = new Object[] {shard.getName()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_NAME, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_NAME, args);

    if ((shardModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_NAME.getColumnBitmask()) != 0) {
      args = new Object[] {shardModelImpl.getOriginalName()};

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_NAME, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_NAME, args);
    }

    args = new Object[] {shard.getClassNameId(), shard.getClassPK()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_C, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C, args);

    if ((shardModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_C_C.getColumnBitmask()) != 0) {
      args =
          new Object[] {
            shardModelImpl.getOriginalClassNameId(), shardModelImpl.getOriginalClassPK()
          };

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_C, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C, args);
    }
  }
  protected void cacheUniqueFindersCache(TipsOfTheDayUsers tipsOfTheDayUsers) {
    if (tipsOfTheDayUsers.isNew()) {
      Object[] args =
          new Object[] {
            tipsOfTheDayUsers.getCompanyId(),
            tipsOfTheDayUsers.getGroupId(),
            tipsOfTheDayUsers.getUserId()
          };

      FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_G_U, args, Long.valueOf(1));
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_G_U, args, tipsOfTheDayUsers);
    } else {
      TipsOfTheDayUsersModelImpl tipsOfTheDayUsersModelImpl =
          (TipsOfTheDayUsersModelImpl) tipsOfTheDayUsers;

      if ((tipsOfTheDayUsersModelImpl.getColumnBitmask()
              & FINDER_PATH_FETCH_BY_C_G_U.getColumnBitmask())
          != 0) {
        Object[] args =
            new Object[] {
              tipsOfTheDayUsers.getCompanyId(),
              tipsOfTheDayUsers.getGroupId(),
              tipsOfTheDayUsers.getUserId()
            };

        FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_G_U, args, Long.valueOf(1));
        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_G_U, args, tipsOfTheDayUsers);
      }
    }
  }
  protected void clearUniqueFindersCache(TipsOfTheDayUsers tipsOfTheDayUsers) {
    TipsOfTheDayUsersModelImpl tipsOfTheDayUsersModelImpl =
        (TipsOfTheDayUsersModelImpl) tipsOfTheDayUsers;

    Object[] args =
        new Object[] {
          tipsOfTheDayUsers.getCompanyId(),
          tipsOfTheDayUsers.getGroupId(),
          tipsOfTheDayUsers.getUserId()
        };

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_G_U, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_G_U, args);

    if ((tipsOfTheDayUsersModelImpl.getColumnBitmask()
            & FINDER_PATH_FETCH_BY_C_G_U.getColumnBitmask())
        != 0) {
      args =
          new Object[] {
            tipsOfTheDayUsersModelImpl.getOriginalCompanyId(),
            tipsOfTheDayUsersModelImpl.getOriginalGroupId(),
            tipsOfTheDayUsersModelImpl.getOriginalUserId()
          };

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_G_U, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_G_U, args);
    }
  }
コード例 #5
0
  @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;
  }
コード例 #6
0
  @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;
  }
  protected void cacheUniqueFindersCache(SemesterModelImpl semesterModelImpl, boolean isNew) {
    if (isNew) {
      Object[] args =
          new Object[] {
            semesterModelImpl.getBeginYear(),
            semesterModelImpl.getEndYear(),
            semesterModelImpl.getDivision()
          };

      finderCache.putResult(FINDER_PATH_COUNT_BY_B_E_D, args, Long.valueOf(1));
      finderCache.putResult(FINDER_PATH_FETCH_BY_B_E_D, args, semesterModelImpl);
    } else {
      if ((semesterModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_B_E_D.getColumnBitmask())
          != 0) {
        Object[] args =
            new Object[] {
              semesterModelImpl.getBeginYear(),
              semesterModelImpl.getEndYear(),
              semesterModelImpl.getDivision()
            };

        finderCache.putResult(FINDER_PATH_COUNT_BY_B_E_D, args, Long.valueOf(1));
        finderCache.putResult(FINDER_PATH_FETCH_BY_B_E_D, args, semesterModelImpl);
      }
    }
  }
コード例 #8
0
  @Override
  public Quota updateImpl(org.lsug.quota.model.Quota quota, boolean merge) throws SystemException {
    quota = toUnwrappedModel(quota);

    boolean isNew = quota.isNew();

    QuotaModelImpl quotaModelImpl = (QuotaModelImpl) quota;

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, quota, merge);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        QuotaModelImpl.ENTITY_CACHE_ENABLED, QuotaImpl.class, quota.getPrimaryKey(), quota);

    if (isNew) {
      FinderCacheUtil.putResult(
          FINDER_PATH_FETCH_BY_CLASSNAMEIDCLASSPK,
          new Object[] {Long.valueOf(quota.getClassNameId()), Long.valueOf(quota.getClassPK())},
          quota);
    } else {
      if ((quotaModelImpl.getColumnBitmask()
              & FINDER_PATH_FETCH_BY_CLASSNAMEIDCLASSPK.getColumnBitmask())
          != 0) {
        Object[] args =
            new Object[] {
              Long.valueOf(quotaModelImpl.getOriginalClassNameId()),
              Long.valueOf(quotaModelImpl.getOriginalClassPK())
            };

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_CLASSNAMEIDCLASSPK, args);

        FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_CLASSNAMEIDCLASSPK, args);

        FinderCacheUtil.putResult(
            FINDER_PATH_FETCH_BY_CLASSNAMEIDCLASSPK,
            new Object[] {Long.valueOf(quota.getClassNameId()), Long.valueOf(quota.getClassPK())},
            quota);
      }
    }

    return quota;
  }
コード例 #9
0
  @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;
  }
コード例 #10
0
  @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;
  }
コード例 #11
0
  @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;
  }
コード例 #12
0
  @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;
  }
コード例 #13
0
  @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;
  }
コード例 #14
0
  @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;
  }
コード例 #15
0
  @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;
  }
コード例 #16
0
  @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;
  }
コード例 #17
0
  @Override
  public ClassName updateImpl(com.liferay.portal.model.ClassName className, boolean merge)
      throws SystemException {
    className = toUnwrappedModel(className);

    boolean isNew = className.isNew();

    ClassNameModelImpl classNameModelImpl = (ClassNameModelImpl) className;

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, className, merge);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        ClassNameModelImpl.ENTITY_CACHE_ENABLED,
        ClassNameImpl.class,
        className.getPrimaryKey(),
        className);

    if (isNew) {
      FinderCacheUtil.putResult(
          FINDER_PATH_FETCH_BY_VALUE, new Object[] {className.getValue()}, className);
    } else {
      if ((classNameModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_VALUE.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {classNameModelImpl.getOriginalValue()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_VALUE, args);
        FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VALUE, args);

        FinderCacheUtil.putResult(
            FINDER_PATH_FETCH_BY_VALUE, new Object[] {className.getValue()}, className);
      }
    }

    return className;
  }
コード例 #18
0
  @Override
  public PanicButton updateImpl(com.ese.ils.beta.model.PanicButton panicButton, boolean merge)
      throws SystemException {
    panicButton = toUnwrappedModel(panicButton);

    boolean isNew = panicButton.isNew();

    PanicButtonModelImpl panicButtonModelImpl = (PanicButtonModelImpl) panicButton;

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, panicButton, merge);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

    if (isNew || !PanicButtonModelImpl.COLUMN_BITMASK_ENABLED) {
      FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
    } else {
      if ((panicButtonModelImpl.getColumnBitmask()
              & FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_BYMODULE.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {Long.valueOf(panicButtonModelImpl.getOriginalModuleId())};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_BYMODULE, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_BYMODULE, args);

        args = new Object[] {Long.valueOf(panicButtonModelImpl.getModuleId())};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_BYMODULE, args);
        FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_BYMODULE, args);
      }
    }

    EntityCacheUtil.putResult(
        PanicButtonModelImpl.ENTITY_CACHE_ENABLED,
        PanicButtonImpl.class,
        panicButton.getPrimaryKey(),
        panicButton);

    return panicButton;
  }
  @Override
  public Advertising updateImpl(com.pinsightmedia.sb.model.Advertising advertising, boolean merge)
      throws SystemException {
    advertising = toUnwrappedModel(advertising);

    boolean isNew = advertising.isNew();

    AdvertisingModelImpl advertisingModelImpl = (AdvertisingModelImpl) advertising;

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, advertising, merge);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

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

        args = new Object[] {Long.valueOf(advertisingModelImpl.getUserId())};

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

    EntityCacheUtil.putResult(
        AdvertisingModelImpl.ENTITY_CACHE_ENABLED,
        AdvertisingImpl.class,
        advertising.getPrimaryKey(),
        advertising);

    return advertising;
  }
コード例 #20
0
  @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;
  }
コード例 #21
0
  protected void clearUniqueFindersCache(DLSyncEvent dlSyncEvent) {
    DLSyncEventModelImpl dlSyncEventModelImpl = (DLSyncEventModelImpl) dlSyncEvent;

    Object[] args = new Object[] {dlSyncEvent.getTypePK()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TYPEPK, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_TYPEPK, args);

    if ((dlSyncEventModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_TYPEPK.getColumnBitmask())
        != 0) {
      args = new Object[] {dlSyncEventModelImpl.getOriginalTypePK()};

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_TYPEPK, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_TYPEPK, args);
    }
  }
コード例 #22
0
  protected void clearUniqueFindersCache(DLSync dlSync) {
    DLSyncModelImpl dlSyncModelImpl = (DLSyncModelImpl) dlSync;

    Object[] args = new Object[] {dlSync.getFileId()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FILEID, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_FILEID, args);

    if ((dlSyncModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_FILEID.getColumnBitmask())
        != 0) {
      args = new Object[] {dlSyncModelImpl.getOriginalFileId()};

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_FILEID, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_FILEID, args);
    }
  }
コード例 #23
0
  protected void clearUniqueFindersCache(SVNRepository svnRepository) {
    SVNRepositoryModelImpl svnRepositoryModelImpl = (SVNRepositoryModelImpl) svnRepository;

    Object[] args = new Object[] {svnRepository.getUrl()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_URL, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_URL, args);

    if ((svnRepositoryModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_URL.getColumnBitmask())
        != 0) {
      args = new Object[] {svnRepositoryModelImpl.getOriginalUrl()};

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_URL, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_URL, args);
    }
  }
コード例 #24
0
  protected void clearUniqueFindersCache(ListType listType) {
    ListTypeModelImpl listTypeModelImpl = (ListTypeModelImpl) listType;

    Object[] args = new Object[] {listType.getName(), listType.getType()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_N_T, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_N_T, args);

    if ((listTypeModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_N_T.getColumnBitmask()) != 0) {
      args =
          new Object[] {listTypeModelImpl.getOriginalName(), listTypeModelImpl.getOriginalType()};

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_N_T, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_N_T, args);
    }
  }
コード例 #25
0
  @Override
  public Ticket updateImpl(com.liferay.portal.model.Ticket ticket, boolean merge)
      throws SystemException {
    ticket = toUnwrappedModel(ticket);

    boolean isNew = ticket.isNew();

    TicketModelImpl ticketModelImpl = (TicketModelImpl) ticket;

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.update(session, ticket, merge);

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

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);

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

    EntityCacheUtil.putResult(
        TicketModelImpl.ENTITY_CACHE_ENABLED, TicketImpl.class, ticket.getPrimaryKey(), ticket);

    if (isNew) {
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_KEY, new Object[] {ticket.getKey()}, ticket);
    } else {
      if ((ticketModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_KEY.getColumnBitmask()) != 0) {
        Object[] args = new Object[] {ticketModelImpl.getOriginalKey()};

        FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_KEY, args);
        FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_KEY, args);

        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_KEY, new Object[] {ticket.getKey()}, ticket);
      }
    }

    return ticket;
  }
コード例 #26
0
  protected void clearUniqueFindersCache(BrowserTracker browserTracker) {
    BrowserTrackerModelImpl browserTrackerModelImpl = (BrowserTrackerModelImpl) browserTracker;

    Object[] args = new Object[] {Long.valueOf(browserTracker.getUserId())};

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

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

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_USERID, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_USERID, args);
    }
  }
コード例 #27
0
  protected void cacheUniqueFindersCache(Entry entry) {
    if (entry.isNew()) {
      Object[] args = new Object[] {entry.getUserId(), entry.getEmailAddress()};

      FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_U_EA, args, Long.valueOf(1));
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_U_EA, args, entry);
    } else {
      EntryModelImpl entryModelImpl = (EntryModelImpl) entry;

      if ((entryModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_U_EA.getColumnBitmask()) != 0) {
        Object[] args = new Object[] {entry.getUserId(), entry.getEmailAddress()};

        FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_U_EA, args, Long.valueOf(1));
        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_U_EA, args, entry);
      }
    }
  }
コード例 #28
0
  protected void clearUniqueFindersCache(Release release) {
    ReleaseModelImpl releaseModelImpl = (ReleaseModelImpl) release;

    Object[] args = new Object[] {release.getServletContextName()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_SERVLETCONTEXTNAME, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME, args);

    if ((releaseModelImpl.getColumnBitmask()
            & FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME.getColumnBitmask())
        != 0) {
      args = new Object[] {releaseModelImpl.getOriginalServletContextName()};

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_SERVLETCONTEXTNAME, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_SERVLETCONTEXTNAME, args);
    }
  }
コード例 #29
0
  protected void cacheUniqueFindersCache(ListType listType) {
    if (listType.isNew()) {
      Object[] args = new Object[] {listType.getName(), listType.getType()};

      FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_N_T, args, Long.valueOf(1));
      FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_N_T, args, listType);
    } else {
      ListTypeModelImpl listTypeModelImpl = (ListTypeModelImpl) listType;

      if ((listTypeModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_N_T.getColumnBitmask())
          != 0) {
        Object[] args = new Object[] {listType.getName(), listType.getType()};

        FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_N_T, args, Long.valueOf(1));
        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_N_T, args, listType);
      }
    }
  }
コード例 #30
0
  protected void clearUniqueFindersCache(Entry entry) {
    EntryModelImpl entryModelImpl = (EntryModelImpl) entry;

    Object[] args = new Object[] {entry.getUserId(), entry.getEmailAddress()};

    FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_U_EA, args);
    FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_U_EA, args);

    if ((entryModelImpl.getColumnBitmask() & FINDER_PATH_FETCH_BY_U_EA.getColumnBitmask()) != 0) {
      args =
          new Object[] {
            entryModelImpl.getOriginalUserId(), entryModelImpl.getOriginalEmailAddress()
          };

      FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_U_EA, args);
      FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_U_EA, args);
    }
  }