@Override
  protected ExpandoRow removeImpl(ExpandoRow expandoRow) throws SystemException {
    expandoRow = toUnwrappedModel(expandoRow);

    Session session = null;

    try {
      session = openSession();

      BatchSessionUtil.delete(session, expandoRow);
    } catch (Exception e) {
      throw processException(e);
    } finally {
      closeSession(session);
    }

    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);

    ExpandoRowModelImpl expandoRowModelImpl = (ExpandoRowModelImpl) expandoRow;

    FinderCacheUtil.removeResult(
        FINDER_PATH_FETCH_BY_T_C,
        new Object[] {
          Long.valueOf(expandoRowModelImpl.getTableId()),
          Long.valueOf(expandoRowModelImpl.getClassPK())
        });

    EntityCacheUtil.removeResult(
        ExpandoRowModelImpl.ENTITY_CACHE_ENABLED, ExpandoRowImpl.class, expandoRow.getPrimaryKey());

    return expandoRow;
  }
  @Test
  public void testResetOriginalValues() throws Exception {
    if (!PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
      return;
    }

    ExpandoRow newExpandoRow = addExpandoRow();

    _persistence.clearCache();

    ExpandoRowModelImpl existingExpandoRowModelImpl =
        (ExpandoRowModelImpl) _persistence.findByPrimaryKey(newExpandoRow.getPrimaryKey());

    Assert.assertEquals(
        existingExpandoRowModelImpl.getTableId(), existingExpandoRowModelImpl.getOriginalTableId());
    Assert.assertEquals(
        existingExpandoRowModelImpl.getClassPK(), existingExpandoRowModelImpl.getOriginalClassPK());
  }