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

    User newUser = addUser();

    _persistence.clearCache();

    UserModelImpl existingUserModelImpl =
        (UserModelImpl) _persistence.findByPrimaryKey(newUser.getPrimaryKey());

    assertEquals(
        existingUserModelImpl.getContactId(), existingUserModelImpl.getOriginalContactId());

    assertEquals(
        existingUserModelImpl.getPortraitId(), existingUserModelImpl.getOriginalPortraitId());

    assertEquals(
        existingUserModelImpl.getCompanyId(), existingUserModelImpl.getOriginalCompanyId());
    assertEquals(existingUserModelImpl.getUserId(), existingUserModelImpl.getOriginalUserId());

    assertEquals(
        existingUserModelImpl.getCompanyId(), existingUserModelImpl.getOriginalCompanyId());
    assertEquals(
        existingUserModelImpl.getDefaultUser(), existingUserModelImpl.getOriginalDefaultUser());

    assertEquals(
        existingUserModelImpl.getCompanyId(), existingUserModelImpl.getOriginalCompanyId());
    assertTrue(
        Validator.equals(
            existingUserModelImpl.getScreenName(), existingUserModelImpl.getOriginalScreenName()));

    assertEquals(
        existingUserModelImpl.getCompanyId(), existingUserModelImpl.getOriginalCompanyId());
    assertTrue(
        Validator.equals(
            existingUserModelImpl.getEmailAddress(),
            existingUserModelImpl.getOriginalEmailAddress()));

    assertEquals(
        existingUserModelImpl.getCompanyId(), existingUserModelImpl.getOriginalCompanyId());
    assertEquals(
        existingUserModelImpl.getFacebookId(), existingUserModelImpl.getOriginalFacebookId());

    assertEquals(
        existingUserModelImpl.getCompanyId(), existingUserModelImpl.getOriginalCompanyId());
    assertTrue(
        Validator.equals(
            existingUserModelImpl.getOpenId(), existingUserModelImpl.getOriginalOpenId()));
  }
  @Override
  public void resetOriginalValues() {
    UserModelImpl userModelImpl = this;

    userModelImpl._originalUserId = userModelImpl._userId;

    userModelImpl._setOriginalUserId = false;

    userModelImpl._originalCompanyId = userModelImpl._companyId;

    userModelImpl._setOriginalCompanyId = false;

    userModelImpl._originalDefaultUser = userModelImpl._defaultUser;

    userModelImpl._setOriginalDefaultUser = false;

    userModelImpl._originalContactId = userModelImpl._contactId;

    userModelImpl._setOriginalContactId = false;

    userModelImpl._originalScreenName = userModelImpl._screenName;

    userModelImpl._originalEmailAddress = userModelImpl._emailAddress;

    userModelImpl._originalFacebookId = userModelImpl._facebookId;

    userModelImpl._setOriginalFacebookId = false;

    userModelImpl._originalOpenId = userModelImpl._openId;

    userModelImpl._originalPortraitId = userModelImpl._portraitId;

    userModelImpl._setOriginalPortraitId = false;
  }