@Override
  protected EmpPersonalDetails removeImpl(EmpPersonalDetails empPersonalDetails)
      throws SystemException {
    empPersonalDetails = toUnwrappedModel(empPersonalDetails);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(empPersonalDetails)) {
        empPersonalDetails =
            (EmpPersonalDetails)
                session.get(EmpPersonalDetailsImpl.class, empPersonalDetails.getPrimaryKeyObj());
      }

      if (empPersonalDetails != null) {
        session.delete(empPersonalDetails);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (empPersonalDetails != null) {
      clearCache(empPersonalDetails);
    }

    return empPersonalDetails;
  }
  @Override
  protected UserTrackerPath removeImpl(UserTrackerPath userTrackerPath) {
    userTrackerPath = toUnwrappedModel(userTrackerPath);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(userTrackerPath)) {
        userTrackerPath =
            (UserTrackerPath)
                session.get(UserTrackerPathImpl.class, userTrackerPath.getPrimaryKeyObj());
      }

      if (userTrackerPath != null) {
        session.delete(userTrackerPath);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (userTrackerPath != null) {
      clearCache(userTrackerPath);
    }

    return userTrackerPath;
  }
  @Override
  protected SVNRepository removeImpl(SVNRepository svnRepository) {
    svnRepository = toUnwrappedModel(svnRepository);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(svnRepository)) {
        svnRepository =
            (SVNRepository) session.get(SVNRepositoryImpl.class, svnRepository.getPrimaryKeyObj());
      }

      if (svnRepository != null) {
        session.delete(svnRepository);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (svnRepository != null) {
      clearCache(svnRepository);
    }

    return svnRepository;
  }
  @Override
  protected OrgLabor removeImpl(OrgLabor orgLabor) throws SystemException {
    orgLabor = toUnwrappedModel(orgLabor);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(orgLabor)) {
        orgLabor = (OrgLabor) session.get(OrgLaborImpl.class, orgLabor.getPrimaryKeyObj());
      }

      if (orgLabor != null) {
        session.delete(orgLabor);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (orgLabor != null) {
      clearCache(orgLabor);
    }

    return orgLabor;
  }
  @Override
  protected WebDAVProps removeImpl(WebDAVProps webDAVProps) {
    webDAVProps = toUnwrappedModel(webDAVProps);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(webDAVProps)) {
        webDAVProps =
            (WebDAVProps) session.get(WebDAVPropsImpl.class, webDAVProps.getPrimaryKeyObj());
      }

      if (webDAVProps != null) {
        session.delete(webDAVProps);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (webDAVProps != null) {
      clearCache(webDAVProps);
    }

    return webDAVProps;
  }
  @Override
  protected ListType removeImpl(ListType listType) {
    listType = toUnwrappedModel(listType);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(listType)) {
        listType = (ListType) session.get(ListTypeImpl.class, listType.getPrimaryKeyObj());
      }

      if (listType != null) {
        session.delete(listType);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (listType != null) {
      clearCache(listType);
    }

    return listType;
  }
  @Override
  protected ShoppingItemPrice removeImpl(ShoppingItemPrice shoppingItemPrice) {
    shoppingItemPrice = toUnwrappedModel(shoppingItemPrice);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(shoppingItemPrice)) {
        shoppingItemPrice =
            (ShoppingItemPrice)
                session.get(ShoppingItemPriceImpl.class, shoppingItemPrice.getPrimaryKeyObj());
      }

      if (shoppingItemPrice != null) {
        session.delete(shoppingItemPrice);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (shoppingItemPrice != null) {
      clearCache(shoppingItemPrice);
    }

    return shoppingItemPrice;
  }
  @Override
  protected JIRAChangeItem removeImpl(JIRAChangeItem jiraChangeItem) throws SystemException {
    jiraChangeItem = toUnwrappedModel(jiraChangeItem);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(jiraChangeItem)) {
        jiraChangeItem =
            (JIRAChangeItem)
                session.get(JIRAChangeItemImpl.class, jiraChangeItem.getPrimaryKeyObj());
      }

      if (jiraChangeItem != null) {
        session.delete(jiraChangeItem);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (jiraChangeItem != null) {
      clearCache(jiraChangeItem);
    }

    return jiraChangeItem;
  }
  @Override
  protected DLSyncEvent removeImpl(DLSyncEvent dlSyncEvent) throws SystemException {
    dlSyncEvent = toUnwrappedModel(dlSyncEvent);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(dlSyncEvent)) {
        dlSyncEvent =
            (DLSyncEvent) session.get(DLSyncEventImpl.class, dlSyncEvent.getPrimaryKeyObj());
      }

      if (dlSyncEvent != null) {
        session.delete(dlSyncEvent);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (dlSyncEvent != null) {
      clearCache(dlSyncEvent);
    }

    return dlSyncEvent;
  }
  protected ProGateMenuView removeImpl(ProGateMenuView proGateMenuView) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      if (proGateMenuView.isCachedModel() || BatchSessionUtil.isEnabled()) {
        Object staleObject =
            session.get(ProGateMenuViewImpl.class, proGateMenuView.getPrimaryKeyObj());

        if (staleObject != null) {
          session.evict(staleObject);
        }
      }

      session.delete(proGateMenuView);

      session.flush();
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        ProGateMenuViewModelImpl.ENTITY_CACHE_ENABLED,
        ProGateMenuViewImpl.class,
        proGateMenuView.getPrimaryKey());

    return proGateMenuView;
  }
  @Override
  protected ProposalRating removeImpl(ProposalRating proposalRating) throws SystemException {
    proposalRating = toUnwrappedModel(proposalRating);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(proposalRating)) {
        proposalRating =
            (ProposalRating)
                session.get(ProposalRatingImpl.class, proposalRating.getPrimaryKeyObj());
      }

      if (proposalRating != null) {
        session.delete(proposalRating);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (proposalRating != null) {
      clearCache(proposalRating);
    }

    return proposalRating;
  }
  @Override
  protected Foo removeImpl(Foo foo) {
    foo = toUnwrappedModel(foo);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(foo)) {
        foo = (Foo) session.get(FooImpl.class, foo.getPrimaryKeyObj());
      }

      if (foo != null) {
        session.delete(foo);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (foo != null) {
      clearCache(foo);
    }

    return foo;
  }
  @Override
  protected PortalPreferences removeImpl(PortalPreferences portalPreferences)
      throws SystemException {
    portalPreferences = toUnwrappedModel(portalPreferences);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(portalPreferences)) {
        portalPreferences =
            (PortalPreferences)
                session.get(PortalPreferencesImpl.class, portalPreferences.getPrimaryKeyObj());
      }

      if (portalPreferences != null) {
        session.delete(portalPreferences);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (portalPreferences != null) {
      clearCache(portalPreferences);
    }

    return portalPreferences;
  }
  @Override
  protected Counter removeImpl(Counter counter) throws SystemException {
    counter = toUnwrappedModel(counter);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(counter)) {
        counter = (Counter) session.get(CounterImpl.class, counter.getPrimaryKeyObj());
      }

      if (counter != null) {
        session.delete(counter);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (counter != null) {
      clearCache(counter);
    }

    return counter;
  }
  protected ViewListTitleCompetencies removeImpl(
      ViewListTitleCompetencies viewListTitleCompetencies) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      if (viewListTitleCompetencies.isCachedModel() || BatchSessionUtil.isEnabled()) {
        Object staleObject =
            session.get(
                ViewListTitleCompetenciesImpl.class, viewListTitleCompetencies.getPrimaryKeyObj());

        if (staleObject != null) {
          session.evict(staleObject);
        }
      }

      session.delete(viewListTitleCompetencies);

      session.flush();
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        ViewListTitleCompetenciesModelImpl.ENTITY_CACHE_ENABLED,
        ViewListTitleCompetenciesImpl.class,
        viewListTitleCompetencies.getPrimaryKey());

    return viewListTitleCompetencies;
  }
  protected DebateItemReference removeImpl(DebateItemReference debateItemReference)
      throws SystemException {
    Session session = null;

    try {
      session = openSession();

      if (debateItemReference.isCachedModel() || BatchSessionUtil.isEnabled()) {
        Object staleObject =
            session.get(DebateItemReferenceImpl.class, debateItemReference.getPrimaryKeyObj());

        if (staleObject != null) {
          session.evict(staleObject);
        }
      }

      session.delete(debateItemReference);

      session.flush();
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    EntityCacheUtil.removeResult(
        DebateItemReferenceModelImpl.ENTITY_CACHE_ENABLED,
        DebateItemReferenceImpl.class,
        debateItemReference.getPrimaryKey());

    return debateItemReference;
  }
  @Override
  protected Semester removeImpl(Semester semester) {
    semester = toUnwrappedModel(semester);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(semester)) {
        semester = (Semester) session.get(SemesterImpl.class, semester.getPrimaryKeyObj());
      }

      if (semester != null) {
        session.delete(semester);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (semester != null) {
      clearCache(semester);
    }

    return semester;
  }
  @Override
  protected Task removeImpl(Task task) throws SystemException {
    task = toUnwrappedModel(task);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(task)) {
        task = (Task) session.get(TaskImpl.class, task.getPrimaryKeyObj());
      }

      if (task != null) {
        session.delete(task);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (task != null) {
      clearCache(task);
    }

    return task;
  }
  @Override
  protected TipsOfTheDayUsers removeImpl(TipsOfTheDayUsers tipsOfTheDayUsers)
      throws SystemException {
    tipsOfTheDayUsers = toUnwrappedModel(tipsOfTheDayUsers);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(tipsOfTheDayUsers)) {
        tipsOfTheDayUsers =
            (TipsOfTheDayUsers)
                session.get(TipsOfTheDayUsersImpl.class, tipsOfTheDayUsers.getPrimaryKeyObj());
      }

      if (tipsOfTheDayUsers != null) {
        session.delete(tipsOfTheDayUsers);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (tipsOfTheDayUsers != null) {
      clearCache(tipsOfTheDayUsers);
    }

    return tipsOfTheDayUsers;
  }
  @Override
  protected ProjectsEntry removeImpl(ProjectsEntry projectsEntry) throws SystemException {
    projectsEntry = toUnwrappedModel(projectsEntry);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(projectsEntry)) {
        projectsEntry =
            (ProjectsEntry) session.get(ProjectsEntryImpl.class, projectsEntry.getPrimaryKeyObj());
      }

      if (projectsEntry != null) {
        session.delete(projectsEntry);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (projectsEntry != null) {
      clearCache(projectsEntry);
    }

    return projectsEntry;
  }
Exemple #21
0
  @Override
  protected Release removeImpl(Release release) throws SystemException {
    release = toUnwrappedModel(release);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(release)) {
        release = (Release) session.get(ReleaseImpl.class, release.getPrimaryKeyObj());
      }

      if (release != null) {
        session.delete(release);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (release != null) {
      clearCache(release);
    }

    return release;
  }
  @Override
  protected Bar removeImpl(Bar bar) {
    bar = toUnwrappedModel(bar);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(bar)) {
        bar = (Bar) session.get(BarImpl.class, bar.getPrimaryKeyObj());
      }

      if (bar != null) {
        session.delete(bar);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (bar != null) {
      clearCache(bar);
    }

    return bar;
  }
Exemple #23
0
  @Override
  protected PasswordTracker removeImpl(PasswordTracker passwordTracker) throws SystemException {
    passwordTracker = toUnwrappedModel(passwordTracker);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(passwordTracker)) {
        passwordTracker =
            (PasswordTracker)
                session.get(PasswordTrackerImpl.class, passwordTracker.getPrimaryKeyObj());
      }

      if (passwordTracker != null) {
        session.delete(passwordTracker);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (passwordTracker != null) {
      clearCache(passwordTracker);
    }

    return passwordTracker;
  }
  @Override
  protected ShoppingItemField removeImpl(ShoppingItemField shoppingItemField)
      throws SystemException {
    shoppingItemField = toUnwrappedModel(shoppingItemField);

    Session session = null;

    try {
      session = openSession();

      if (shoppingItemField.isCachedModel()) {
        shoppingItemField =
            (ShoppingItemField)
                session.get(ShoppingItemFieldImpl.class, shoppingItemField.getPrimaryKeyObj());
      }

      session.delete(shoppingItemField);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    clearCache(shoppingItemField);

    return shoppingItemField;
  }
  @Override
  protected Shard removeImpl(Shard shard) throws SystemException {
    shard = toUnwrappedModel(shard);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(shard)) {
        shard = (Shard) session.get(ShardImpl.class, shard.getPrimaryKeyObj());
      }

      if (shard != null) {
        session.delete(shard);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (shard != null) {
      clearCache(shard);
    }

    return shard;
  }
  @Override
  protected Asset removeImpl(Asset asset) throws SystemException {
    asset = toUnwrappedModel(asset);

    Session session = null;

    try {
      session = openSession();

      if (!session.contains(asset)) {
        asset = (Asset) session.get(AssetImpl.class, asset.getPrimaryKeyObj());
      }

      if (asset != null) {
        session.delete(asset);
      }
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    if (asset != null) {
      clearCache(asset);
    }

    return asset;
  }
  protected LogVanBanNoiBo removeImpl(LogVanBanNoiBo logVanBanNoiBo) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      session.delete(logVanBanNoiBo);

      session.flush();

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

      FinderCacheUtil.clearCache(LogVanBanNoiBo.class.getName());
    }
  }
  protected PmlEdmLevelSend removeImpl(PmlEdmLevelSend pmlEdmLevelSend) throws SystemException {
    Session session = null;

    try {
      session = openSession();

      session.delete(pmlEdmLevelSend);

      session.flush();

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

      FinderCacheUtil.clearCache(PmlEdmLevelSend.class.getName());
    }
  }
  @Override
  protected Image removeImpl(Image image) throws SystemException {
    image = toUnwrappedModel(image);

    Session session = null;

    try {
      session = openSession();

      if (image.isCachedModel()) {
        image = (Image) session.get(ImageImpl.class, image.getPrimaryKeyObj());
      }

      session.delete(image);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    clearCache(image);

    return image;
  }
Exemple #30
0
  public void reset(String name) throws SystemException {
    CounterRegister counterRegister = getCounterRegister(name);

    synchronized (counterRegister) {
      Session session = null;

      try {
        session = openSession();

        Counter counter = (Counter) session.get(CounterImpl.class, name);

        session.delete(counter);

        session.flush();
      } catch (ObjectNotFoundException onfe) {
      } catch (Exception e) {
        throw processException(e);
      } finally {
        closeSession(session);
      }

      _counterRegisterMap.remove(name);
    }
  }