public void testUpdateExisting() throws Exception {
    long pk = nextLong();

    SocialEquityLog newSocialEquityLog = _persistence.create(pk);

    newSocialEquityLog.setGroupId(nextLong());
    newSocialEquityLog.setCompanyId(nextLong());
    newSocialEquityLog.setUserId(nextLong());
    newSocialEquityLog.setAssetEntryId(nextLong());
    newSocialEquityLog.setActionId(randomString());
    newSocialEquityLog.setActionDate(nextInt());
    newSocialEquityLog.setActive(randomBoolean());
    newSocialEquityLog.setExpiration(nextInt());
    newSocialEquityLog.setType(nextInt());
    newSocialEquityLog.setValue(nextInt());
    newSocialEquityLog.setExtraData(randomString());

    _persistence.update(newSocialEquityLog, false);

    SocialEquityLog existingSocialEquityLog =
        _persistence.findByPrimaryKey(newSocialEquityLog.getPrimaryKey());

    assertEquals(existingSocialEquityLog.getEquityLogId(), newSocialEquityLog.getEquityLogId());
    assertEquals(existingSocialEquityLog.getGroupId(), newSocialEquityLog.getGroupId());
    assertEquals(existingSocialEquityLog.getCompanyId(), newSocialEquityLog.getCompanyId());
    assertEquals(existingSocialEquityLog.getUserId(), newSocialEquityLog.getUserId());
    assertEquals(existingSocialEquityLog.getAssetEntryId(), newSocialEquityLog.getAssetEntryId());
    assertEquals(existingSocialEquityLog.getActionId(), newSocialEquityLog.getActionId());
    assertEquals(existingSocialEquityLog.getActionDate(), newSocialEquityLog.getActionDate());
    assertEquals(existingSocialEquityLog.getActive(), newSocialEquityLog.getActive());
    assertEquals(existingSocialEquityLog.getExpiration(), newSocialEquityLog.getExpiration());
    assertEquals(existingSocialEquityLog.getType(), newSocialEquityLog.getType());
    assertEquals(existingSocialEquityLog.getValue(), newSocialEquityLog.getValue());
    assertEquals(existingSocialEquityLog.getExtraData(), newSocialEquityLog.getExtraData());
  }
  protected SocialEquityLog addSocialEquityLog() throws Exception {
    long pk = nextLong();

    SocialEquityLog socialEquityLog = _persistence.create(pk);

    socialEquityLog.setGroupId(nextLong());
    socialEquityLog.setCompanyId(nextLong());
    socialEquityLog.setUserId(nextLong());
    socialEquityLog.setAssetEntryId(nextLong());
    socialEquityLog.setActionId(randomString());
    socialEquityLog.setActionDate(nextInt());
    socialEquityLog.setActive(randomBoolean());
    socialEquityLog.setExpiration(nextInt());
    socialEquityLog.setType(nextInt());
    socialEquityLog.setValue(nextInt());
    socialEquityLog.setExtraData(randomString());

    _persistence.update(socialEquityLog, false);

    return socialEquityLog;
  }