protected MBBan addMBBan() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBBan mbBan = _persistence.create(pk);

    mbBan.setUuid(RandomTestUtil.randomString());

    mbBan.setGroupId(RandomTestUtil.nextLong());

    mbBan.setCompanyId(RandomTestUtil.nextLong());

    mbBan.setUserId(RandomTestUtil.nextLong());

    mbBan.setUserName(RandomTestUtil.randomString());

    mbBan.setCreateDate(RandomTestUtil.nextDate());

    mbBan.setModifiedDate(RandomTestUtil.nextDate());

    mbBan.setBanUserId(RandomTestUtil.nextLong());

    _mbBans.add(_persistence.update(mbBan));

    return mbBan;
  }
  protected MDRRuleGroup addMDRRuleGroup() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MDRRuleGroup mdrRuleGroup = _persistence.create(pk);

    mdrRuleGroup.setUuid(RandomTestUtil.randomString());

    mdrRuleGroup.setGroupId(RandomTestUtil.nextLong());

    mdrRuleGroup.setCompanyId(RandomTestUtil.nextLong());

    mdrRuleGroup.setUserId(RandomTestUtil.nextLong());

    mdrRuleGroup.setUserName(RandomTestUtil.randomString());

    mdrRuleGroup.setCreateDate(RandomTestUtil.nextDate());

    mdrRuleGroup.setModifiedDate(RandomTestUtil.nextDate());

    mdrRuleGroup.setName(RandomTestUtil.randomString());

    mdrRuleGroup.setDescription(RandomTestUtil.randomString());

    _persistence.update(mdrRuleGroup);

    return mdrRuleGroup;
  }
  protected Team addTeam() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Team team = _persistence.create(pk);

    team.setMvccVersion(RandomTestUtil.nextLong());

    team.setCompanyId(RandomTestUtil.nextLong());

    team.setUserId(RandomTestUtil.nextLong());

    team.setUserName(RandomTestUtil.randomString());

    team.setCreateDate(RandomTestUtil.nextDate());

    team.setModifiedDate(RandomTestUtil.nextDate());

    team.setGroupId(RandomTestUtil.nextLong());

    team.setName(RandomTestUtil.randomString());

    team.setDescription(RandomTestUtil.randomString());

    _teams.add(_persistence.update(team));

    return team;
  }
  protected DLFileVersion addDLFileVersion() throws Exception {
    long pk = RandomTestUtil.nextLong();

    DLFileVersion dlFileVersion = _persistence.create(pk);

    dlFileVersion.setUuid(RandomTestUtil.randomString());

    dlFileVersion.setGroupId(RandomTestUtil.nextLong());

    dlFileVersion.setCompanyId(RandomTestUtil.nextLong());

    dlFileVersion.setUserId(RandomTestUtil.nextLong());

    dlFileVersion.setUserName(RandomTestUtil.randomString());

    dlFileVersion.setCreateDate(RandomTestUtil.nextDate());

    dlFileVersion.setModifiedDate(RandomTestUtil.nextDate());

    dlFileVersion.setRepositoryId(RandomTestUtil.nextLong());

    dlFileVersion.setFolderId(RandomTestUtil.nextLong());

    dlFileVersion.setFileEntryId(RandomTestUtil.nextLong());

    dlFileVersion.setTreePath(RandomTestUtil.randomString());

    dlFileVersion.setExtension(RandomTestUtil.randomString());

    dlFileVersion.setMimeType(RandomTestUtil.randomString());

    dlFileVersion.setTitle(RandomTestUtil.randomString());

    dlFileVersion.setDescription(RandomTestUtil.randomString());

    dlFileVersion.setChangeLog(RandomTestUtil.randomString());

    dlFileVersion.setExtraSettings(RandomTestUtil.randomString());

    dlFileVersion.setFileEntryTypeId(RandomTestUtil.nextLong());

    dlFileVersion.setVersion(RandomTestUtil.randomString());

    dlFileVersion.setSize(RandomTestUtil.nextLong());

    dlFileVersion.setChecksum(RandomTestUtil.randomString());

    dlFileVersion.setStatus(RandomTestUtil.nextInt());

    dlFileVersion.setStatusByUserId(RandomTestUtil.nextLong());

    dlFileVersion.setStatusByUserName(RandomTestUtil.randomString());

    dlFileVersion.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(dlFileVersion);

    return dlFileVersion;
  }
  protected MBMailingList addMBMailingList() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBMailingList mbMailingList = _persistence.create(pk);

    mbMailingList.setUuid(RandomTestUtil.randomString());

    mbMailingList.setGroupId(RandomTestUtil.nextLong());

    mbMailingList.setCompanyId(RandomTestUtil.nextLong());

    mbMailingList.setUserId(RandomTestUtil.nextLong());

    mbMailingList.setUserName(RandomTestUtil.randomString());

    mbMailingList.setCreateDate(RandomTestUtil.nextDate());

    mbMailingList.setModifiedDate(RandomTestUtil.nextDate());

    mbMailingList.setCategoryId(RandomTestUtil.nextLong());

    mbMailingList.setEmailAddress(RandomTestUtil.randomString());

    mbMailingList.setInProtocol(RandomTestUtil.randomString());

    mbMailingList.setInServerName(RandomTestUtil.randomString());

    mbMailingList.setInServerPort(RandomTestUtil.nextInt());

    mbMailingList.setInUseSSL(RandomTestUtil.randomBoolean());

    mbMailingList.setInUserName(RandomTestUtil.randomString());

    mbMailingList.setInPassword(RandomTestUtil.randomString());

    mbMailingList.setInReadInterval(RandomTestUtil.nextInt());

    mbMailingList.setOutEmailAddress(RandomTestUtil.randomString());

    mbMailingList.setOutCustom(RandomTestUtil.randomBoolean());

    mbMailingList.setOutServerName(RandomTestUtil.randomString());

    mbMailingList.setOutServerPort(RandomTestUtil.nextInt());

    mbMailingList.setOutUseSSL(RandomTestUtil.randomBoolean());

    mbMailingList.setOutUserName(RandomTestUtil.randomString());

    mbMailingList.setOutPassword(RandomTestUtil.randomString());

    mbMailingList.setAllowAnonymous(RandomTestUtil.randomBoolean());

    mbMailingList.setActive(RandomTestUtil.randomBoolean());

    _persistence.update(mbMailingList);

    return mbMailingList;
  }
  protected MBMessage addMBMessage() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBMessage mbMessage = _persistence.create(pk);

    mbMessage.setUuid(RandomTestUtil.randomString());

    mbMessage.setGroupId(RandomTestUtil.nextLong());

    mbMessage.setCompanyId(RandomTestUtil.nextLong());

    mbMessage.setUserId(RandomTestUtil.nextLong());

    mbMessage.setUserName(RandomTestUtil.randomString());

    mbMessage.setCreateDate(RandomTestUtil.nextDate());

    mbMessage.setModifiedDate(RandomTestUtil.nextDate());

    mbMessage.setClassNameId(RandomTestUtil.nextLong());

    mbMessage.setClassPK(RandomTestUtil.nextLong());

    mbMessage.setCategoryId(RandomTestUtil.nextLong());

    mbMessage.setThreadId(RandomTestUtil.nextLong());

    mbMessage.setRootMessageId(RandomTestUtil.nextLong());

    mbMessage.setParentMessageId(RandomTestUtil.nextLong());

    mbMessage.setSubject(RandomTestUtil.randomString());

    mbMessage.setBody(RandomTestUtil.randomString());

    mbMessage.setFormat(RandomTestUtil.randomString());

    mbMessage.setAnonymous(RandomTestUtil.randomBoolean());

    mbMessage.setPriority(RandomTestUtil.nextDouble());

    mbMessage.setAllowPingbacks(RandomTestUtil.randomBoolean());

    mbMessage.setAnswer(RandomTestUtil.randomBoolean());

    mbMessage.setStatus(RandomTestUtil.nextInt());

    mbMessage.setStatusByUserId(RandomTestUtil.nextLong());

    mbMessage.setStatusByUserName(RandomTestUtil.randomString());

    mbMessage.setStatusDate(RandomTestUtil.nextDate());

    _mbMessages.add(_persistence.update(mbMessage));

    return mbMessage;
  }
  @Test
  public void testCountByL_P() {
    try {
      _persistence.countByL_P(RandomTestUtil.nextDate(), RandomTestUtil.nextDouble());

      _persistence.countByL_P(RandomTestUtil.nextDate(), 0D);
    } catch (Exception e) {
      Assert.fail(e.getMessage());
    }
  }
  @Test
  public void testCountByG_C_L() {
    try {
      _persistence.countByG_C_L(
          RandomTestUtil.nextLong(), RandomTestUtil.nextLong(), RandomTestUtil.nextDate());

      _persistence.countByG_C_L(0L, 0L, RandomTestUtil.nextDate());
    } catch (Exception e) {
      Assert.fail(e.getMessage());
    }
  }
  protected CalEvent addCalEvent() throws Exception {
    long pk = RandomTestUtil.nextLong();

    CalEvent calEvent = _persistence.create(pk);

    calEvent.setUuid(RandomTestUtil.randomString());

    calEvent.setGroupId(RandomTestUtil.nextLong());

    calEvent.setCompanyId(RandomTestUtil.nextLong());

    calEvent.setUserId(RandomTestUtil.nextLong());

    calEvent.setUserName(RandomTestUtil.randomString());

    calEvent.setCreateDate(RandomTestUtil.nextDate());

    calEvent.setModifiedDate(RandomTestUtil.nextDate());

    calEvent.setTitle(RandomTestUtil.randomString());

    calEvent.setDescription(RandomTestUtil.randomString());

    calEvent.setLocation(RandomTestUtil.randomString());

    calEvent.setStartDate(RandomTestUtil.nextDate());

    calEvent.setEndDate(RandomTestUtil.nextDate());

    calEvent.setDurationHour(RandomTestUtil.nextInt());

    calEvent.setDurationMinute(RandomTestUtil.nextInt());

    calEvent.setAllDay(RandomTestUtil.randomBoolean());

    calEvent.setTimeZoneSensitive(RandomTestUtil.randomBoolean());

    calEvent.setType(RandomTestUtil.randomString());

    calEvent.setRepeating(RandomTestUtil.randomBoolean());

    calEvent.setRecurrence(RandomTestUtil.randomString());

    calEvent.setRemindBy(RandomTestUtil.nextInt());

    calEvent.setFirstReminder(RandomTestUtil.nextInt());

    calEvent.setSecondReminder(RandomTestUtil.nextInt());

    _persistence.update(calEvent);

    return calEvent;
  }
  protected DLFolder addDLFolder() throws Exception {
    long pk = RandomTestUtil.nextLong();

    DLFolder dlFolder = _persistence.create(pk);

    dlFolder.setUuid(RandomTestUtil.randomString());

    dlFolder.setGroupId(RandomTestUtil.nextLong());

    dlFolder.setCompanyId(RandomTestUtil.nextLong());

    dlFolder.setUserId(RandomTestUtil.nextLong());

    dlFolder.setUserName(RandomTestUtil.randomString());

    dlFolder.setCreateDate(RandomTestUtil.nextDate());

    dlFolder.setModifiedDate(RandomTestUtil.nextDate());

    dlFolder.setRepositoryId(RandomTestUtil.nextLong());

    dlFolder.setMountPoint(RandomTestUtil.randomBoolean());

    dlFolder.setParentFolderId(RandomTestUtil.nextLong());

    dlFolder.setTreePath(RandomTestUtil.randomString());

    dlFolder.setName(RandomTestUtil.randomString());

    dlFolder.setDescription(RandomTestUtil.randomString());

    dlFolder.setLastPostDate(RandomTestUtil.nextDate());

    dlFolder.setDefaultFileEntryTypeId(RandomTestUtil.nextLong());

    dlFolder.setHidden(RandomTestUtil.randomBoolean());

    dlFolder.setOverrideFileEntryTypes(RandomTestUtil.randomBoolean());

    dlFolder.setStatus(RandomTestUtil.nextInt());

    dlFolder.setStatusByUserId(RandomTestUtil.nextLong());

    dlFolder.setStatusByUserName(RandomTestUtil.randomString());

    dlFolder.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(dlFolder);

    return dlFolder;
  }
  protected MBThread addMBThread() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBThread mbThread = _persistence.create(pk);

    mbThread.setUuid(RandomTestUtil.randomString());

    mbThread.setGroupId(RandomTestUtil.nextLong());

    mbThread.setCompanyId(RandomTestUtil.nextLong());

    mbThread.setUserId(RandomTestUtil.nextLong());

    mbThread.setUserName(RandomTestUtil.randomString());

    mbThread.setCreateDate(RandomTestUtil.nextDate());

    mbThread.setModifiedDate(RandomTestUtil.nextDate());

    mbThread.setCategoryId(RandomTestUtil.nextLong());

    mbThread.setRootMessageId(RandomTestUtil.nextLong());

    mbThread.setRootMessageUserId(RandomTestUtil.nextLong());

    mbThread.setMessageCount(RandomTestUtil.nextInt());

    mbThread.setViewCount(RandomTestUtil.nextInt());

    mbThread.setLastPostByUserId(RandomTestUtil.nextLong());

    mbThread.setLastPostDate(RandomTestUtil.nextDate());

    mbThread.setPriority(RandomTestUtil.nextDouble());

    mbThread.setQuestion(RandomTestUtil.randomBoolean());

    mbThread.setStatus(RandomTestUtil.nextInt());

    mbThread.setStatusByUserId(RandomTestUtil.nextLong());

    mbThread.setStatusByUserName(RandomTestUtil.randomString());

    mbThread.setStatusDate(RandomTestUtil.nextDate());

    _mbThreads.add(_persistence.update(mbThread));

    return mbThread;
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MDRRuleGroup newMDRRuleGroup = _persistence.create(pk);

    newMDRRuleGroup.setUuid(RandomTestUtil.randomString());

    newMDRRuleGroup.setGroupId(RandomTestUtil.nextLong());

    newMDRRuleGroup.setCompanyId(RandomTestUtil.nextLong());

    newMDRRuleGroup.setUserId(RandomTestUtil.nextLong());

    newMDRRuleGroup.setUserName(RandomTestUtil.randomString());

    newMDRRuleGroup.setCreateDate(RandomTestUtil.nextDate());

    newMDRRuleGroup.setModifiedDate(RandomTestUtil.nextDate());

    newMDRRuleGroup.setName(RandomTestUtil.randomString());

    newMDRRuleGroup.setDescription(RandomTestUtil.randomString());

    _persistence.update(newMDRRuleGroup);

    MDRRuleGroup existingMDRRuleGroup =
        _persistence.findByPrimaryKey(newMDRRuleGroup.getPrimaryKey());

    Assert.assertEquals(existingMDRRuleGroup.getUuid(), newMDRRuleGroup.getUuid());
    Assert.assertEquals(existingMDRRuleGroup.getRuleGroupId(), newMDRRuleGroup.getRuleGroupId());
    Assert.assertEquals(existingMDRRuleGroup.getGroupId(), newMDRRuleGroup.getGroupId());
    Assert.assertEquals(existingMDRRuleGroup.getCompanyId(), newMDRRuleGroup.getCompanyId());
    Assert.assertEquals(existingMDRRuleGroup.getUserId(), newMDRRuleGroup.getUserId());
    Assert.assertEquals(existingMDRRuleGroup.getUserName(), newMDRRuleGroup.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMDRRuleGroup.getCreateDate()),
        Time.getShortTimestamp(newMDRRuleGroup.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingMDRRuleGroup.getModifiedDate()),
        Time.getShortTimestamp(newMDRRuleGroup.getModifiedDate()));
    Assert.assertEquals(existingMDRRuleGroup.getName(), newMDRRuleGroup.getName());
    Assert.assertEquals(existingMDRRuleGroup.getDescription(), newMDRRuleGroup.getDescription());
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Team newTeam = _persistence.create(pk);

    newTeam.setMvccVersion(RandomTestUtil.nextLong());

    newTeam.setCompanyId(RandomTestUtil.nextLong());

    newTeam.setUserId(RandomTestUtil.nextLong());

    newTeam.setUserName(RandomTestUtil.randomString());

    newTeam.setCreateDate(RandomTestUtil.nextDate());

    newTeam.setModifiedDate(RandomTestUtil.nextDate());

    newTeam.setGroupId(RandomTestUtil.nextLong());

    newTeam.setName(RandomTestUtil.randomString());

    newTeam.setDescription(RandomTestUtil.randomString());

    _teams.add(_persistence.update(newTeam));

    Team existingTeam = _persistence.findByPrimaryKey(newTeam.getPrimaryKey());

    Assert.assertEquals(existingTeam.getMvccVersion(), newTeam.getMvccVersion());
    Assert.assertEquals(existingTeam.getTeamId(), newTeam.getTeamId());
    Assert.assertEquals(existingTeam.getCompanyId(), newTeam.getCompanyId());
    Assert.assertEquals(existingTeam.getUserId(), newTeam.getUserId());
    Assert.assertEquals(existingTeam.getUserName(), newTeam.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingTeam.getCreateDate()),
        Time.getShortTimestamp(newTeam.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingTeam.getModifiedDate()),
        Time.getShortTimestamp(newTeam.getModifiedDate()));
    Assert.assertEquals(existingTeam.getGroupId(), newTeam.getGroupId());
    Assert.assertEquals(existingTeam.getName(), newTeam.getName());
    Assert.assertEquals(existingTeam.getDescription(), newTeam.getDescription());
  }
  protected DLFileShortcut addDLFileShortcut() throws Exception {
    long pk = RandomTestUtil.nextLong();

    DLFileShortcut dlFileShortcut = _persistence.create(pk);

    dlFileShortcut.setUuid(RandomTestUtil.randomString());

    dlFileShortcut.setGroupId(RandomTestUtil.nextLong());

    dlFileShortcut.setCompanyId(RandomTestUtil.nextLong());

    dlFileShortcut.setUserId(RandomTestUtil.nextLong());

    dlFileShortcut.setUserName(RandomTestUtil.randomString());

    dlFileShortcut.setCreateDate(RandomTestUtil.nextDate());

    dlFileShortcut.setModifiedDate(RandomTestUtil.nextDate());

    dlFileShortcut.setRepositoryId(RandomTestUtil.nextLong());

    dlFileShortcut.setFolderId(RandomTestUtil.nextLong());

    dlFileShortcut.setToFileEntryId(RandomTestUtil.nextLong());

    dlFileShortcut.setTreePath(RandomTestUtil.randomString());

    dlFileShortcut.setActive(RandomTestUtil.randomBoolean());

    dlFileShortcut.setStatus(RandomTestUtil.nextInt());

    dlFileShortcut.setStatusByUserId(RandomTestUtil.nextLong());

    dlFileShortcut.setStatusByUserName(RandomTestUtil.randomString());

    dlFileShortcut.setStatusDate(RandomTestUtil.nextDate());

    _dlFileShortcuts.add(_persistence.update(dlFileShortcut));

    return dlFileShortcut;
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBBan newMBBan = _persistence.create(pk);

    newMBBan.setUuid(RandomTestUtil.randomString());

    newMBBan.setGroupId(RandomTestUtil.nextLong());

    newMBBan.setCompanyId(RandomTestUtil.nextLong());

    newMBBan.setUserId(RandomTestUtil.nextLong());

    newMBBan.setUserName(RandomTestUtil.randomString());

    newMBBan.setCreateDate(RandomTestUtil.nextDate());

    newMBBan.setModifiedDate(RandomTestUtil.nextDate());

    newMBBan.setBanUserId(RandomTestUtil.nextLong());

    _mbBans.add(_persistence.update(newMBBan));

    MBBan existingMBBan = _persistence.findByPrimaryKey(newMBBan.getPrimaryKey());

    Assert.assertEquals(existingMBBan.getUuid(), newMBBan.getUuid());
    Assert.assertEquals(existingMBBan.getBanId(), newMBBan.getBanId());
    Assert.assertEquals(existingMBBan.getGroupId(), newMBBan.getGroupId());
    Assert.assertEquals(existingMBBan.getCompanyId(), newMBBan.getCompanyId());
    Assert.assertEquals(existingMBBan.getUserId(), newMBBan.getUserId());
    Assert.assertEquals(existingMBBan.getUserName(), newMBBan.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBBan.getCreateDate()),
        Time.getShortTimestamp(newMBBan.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBBan.getModifiedDate()),
        Time.getShortTimestamp(newMBBan.getModifiedDate()));
    Assert.assertEquals(existingMBBan.getBanUserId(), newMBBan.getBanUserId());
  }
  protected ExportImportConfiguration addExportImportConfiguration() throws Exception {
    long pk = RandomTestUtil.nextLong();

    ExportImportConfiguration exportImportConfiguration = _persistence.create(pk);

    exportImportConfiguration.setMvccVersion(RandomTestUtil.nextLong());

    exportImportConfiguration.setGroupId(RandomTestUtil.nextLong());

    exportImportConfiguration.setCompanyId(RandomTestUtil.nextLong());

    exportImportConfiguration.setUserId(RandomTestUtil.nextLong());

    exportImportConfiguration.setUserName(RandomTestUtil.randomString());

    exportImportConfiguration.setCreateDate(RandomTestUtil.nextDate());

    exportImportConfiguration.setModifiedDate(RandomTestUtil.nextDate());

    exportImportConfiguration.setName(RandomTestUtil.randomString());

    exportImportConfiguration.setDescription(RandomTestUtil.randomString());

    exportImportConfiguration.setType(RandomTestUtil.nextInt());

    exportImportConfiguration.setSettings(RandomTestUtil.randomString());

    exportImportConfiguration.setStatus(RandomTestUtil.nextInt());

    exportImportConfiguration.setStatusByUserId(RandomTestUtil.nextLong());

    exportImportConfiguration.setStatusByUserName(RandomTestUtil.randomString());

    exportImportConfiguration.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(exportImportConfiguration);

    return exportImportConfiguration;
  }
  protected WikiNode addWikiNode() throws Exception {
    long pk = RandomTestUtil.nextLong();

    WikiNode wikiNode = _persistence.create(pk);

    wikiNode.setUuid(RandomTestUtil.randomString());

    wikiNode.setGroupId(RandomTestUtil.nextLong());

    wikiNode.setCompanyId(RandomTestUtil.nextLong());

    wikiNode.setUserId(RandomTestUtil.nextLong());

    wikiNode.setUserName(RandomTestUtil.randomString());

    wikiNode.setCreateDate(RandomTestUtil.nextDate());

    wikiNode.setModifiedDate(RandomTestUtil.nextDate());

    wikiNode.setName(RandomTestUtil.randomString());

    wikiNode.setDescription(RandomTestUtil.randomString());

    wikiNode.setLastPostDate(RandomTestUtil.nextDate());

    wikiNode.setStatus(RandomTestUtil.nextInt());

    wikiNode.setStatusByUserId(RandomTestUtil.nextLong());

    wikiNode.setStatusByUserName(RandomTestUtil.randomString());

    wikiNode.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(wikiNode);

    return wikiNode;
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBMailingList newMBMailingList = _persistence.create(pk);

    newMBMailingList.setUuid(RandomTestUtil.randomString());

    newMBMailingList.setGroupId(RandomTestUtil.nextLong());

    newMBMailingList.setCompanyId(RandomTestUtil.nextLong());

    newMBMailingList.setUserId(RandomTestUtil.nextLong());

    newMBMailingList.setUserName(RandomTestUtil.randomString());

    newMBMailingList.setCreateDate(RandomTestUtil.nextDate());

    newMBMailingList.setModifiedDate(RandomTestUtil.nextDate());

    newMBMailingList.setCategoryId(RandomTestUtil.nextLong());

    newMBMailingList.setEmailAddress(RandomTestUtil.randomString());

    newMBMailingList.setInProtocol(RandomTestUtil.randomString());

    newMBMailingList.setInServerName(RandomTestUtil.randomString());

    newMBMailingList.setInServerPort(RandomTestUtil.nextInt());

    newMBMailingList.setInUseSSL(RandomTestUtil.randomBoolean());

    newMBMailingList.setInUserName(RandomTestUtil.randomString());

    newMBMailingList.setInPassword(RandomTestUtil.randomString());

    newMBMailingList.setInReadInterval(RandomTestUtil.nextInt());

    newMBMailingList.setOutEmailAddress(RandomTestUtil.randomString());

    newMBMailingList.setOutCustom(RandomTestUtil.randomBoolean());

    newMBMailingList.setOutServerName(RandomTestUtil.randomString());

    newMBMailingList.setOutServerPort(RandomTestUtil.nextInt());

    newMBMailingList.setOutUseSSL(RandomTestUtil.randomBoolean());

    newMBMailingList.setOutUserName(RandomTestUtil.randomString());

    newMBMailingList.setOutPassword(RandomTestUtil.randomString());

    newMBMailingList.setAllowAnonymous(RandomTestUtil.randomBoolean());

    newMBMailingList.setActive(RandomTestUtil.randomBoolean());

    _persistence.update(newMBMailingList);

    MBMailingList existingMBMailingList =
        _persistence.findByPrimaryKey(newMBMailingList.getPrimaryKey());

    Assert.assertEquals(existingMBMailingList.getUuid(), newMBMailingList.getUuid());
    Assert.assertEquals(
        existingMBMailingList.getMailingListId(), newMBMailingList.getMailingListId());
    Assert.assertEquals(existingMBMailingList.getGroupId(), newMBMailingList.getGroupId());
    Assert.assertEquals(existingMBMailingList.getCompanyId(), newMBMailingList.getCompanyId());
    Assert.assertEquals(existingMBMailingList.getUserId(), newMBMailingList.getUserId());
    Assert.assertEquals(existingMBMailingList.getUserName(), newMBMailingList.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBMailingList.getCreateDate()),
        Time.getShortTimestamp(newMBMailingList.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBMailingList.getModifiedDate()),
        Time.getShortTimestamp(newMBMailingList.getModifiedDate()));
    Assert.assertEquals(existingMBMailingList.getCategoryId(), newMBMailingList.getCategoryId());
    Assert.assertEquals(
        existingMBMailingList.getEmailAddress(), newMBMailingList.getEmailAddress());
    Assert.assertEquals(existingMBMailingList.getInProtocol(), newMBMailingList.getInProtocol());
    Assert.assertEquals(
        existingMBMailingList.getInServerName(), newMBMailingList.getInServerName());
    Assert.assertEquals(
        existingMBMailingList.getInServerPort(), newMBMailingList.getInServerPort());
    Assert.assertEquals(existingMBMailingList.getInUseSSL(), newMBMailingList.getInUseSSL());
    Assert.assertEquals(existingMBMailingList.getInUserName(), newMBMailingList.getInUserName());
    Assert.assertEquals(existingMBMailingList.getInPassword(), newMBMailingList.getInPassword());
    Assert.assertEquals(
        existingMBMailingList.getInReadInterval(), newMBMailingList.getInReadInterval());
    Assert.assertEquals(
        existingMBMailingList.getOutEmailAddress(), newMBMailingList.getOutEmailAddress());
    Assert.assertEquals(existingMBMailingList.getOutCustom(), newMBMailingList.getOutCustom());
    Assert.assertEquals(
        existingMBMailingList.getOutServerName(), newMBMailingList.getOutServerName());
    Assert.assertEquals(
        existingMBMailingList.getOutServerPort(), newMBMailingList.getOutServerPort());
    Assert.assertEquals(existingMBMailingList.getOutUseSSL(), newMBMailingList.getOutUseSSL());
    Assert.assertEquals(existingMBMailingList.getOutUserName(), newMBMailingList.getOutUserName());
    Assert.assertEquals(existingMBMailingList.getOutPassword(), newMBMailingList.getOutPassword());
    Assert.assertEquals(
        existingMBMailingList.getAllowAnonymous(), newMBMailingList.getAllowAnonymous());
    Assert.assertEquals(existingMBMailingList.getActive(), newMBMailingList.getActive());
  }
  protected JournalArticle addJournalArticle() throws Exception {
    long pk = RandomTestUtil.nextLong();

    JournalArticle journalArticle = _persistence.create(pk);

    journalArticle.setUuid(RandomTestUtil.randomString());

    journalArticle.setResourcePrimKey(RandomTestUtil.nextLong());

    journalArticle.setGroupId(RandomTestUtil.nextLong());

    journalArticle.setCompanyId(RandomTestUtil.nextLong());

    journalArticle.setUserId(RandomTestUtil.nextLong());

    journalArticle.setUserName(RandomTestUtil.randomString());

    journalArticle.setCreateDate(RandomTestUtil.nextDate());

    journalArticle.setModifiedDate(RandomTestUtil.nextDate());

    journalArticle.setFolderId(RandomTestUtil.nextLong());

    journalArticle.setClassNameId(RandomTestUtil.nextLong());

    journalArticle.setClassPK(RandomTestUtil.nextLong());

    journalArticle.setTreePath(RandomTestUtil.randomString());

    journalArticle.setArticleId(RandomTestUtil.randomString());

    journalArticle.setVersion(RandomTestUtil.nextDouble());

    journalArticle.setTitle(RandomTestUtil.randomString());

    journalArticle.setUrlTitle(RandomTestUtil.randomString());

    journalArticle.setDescription(RandomTestUtil.randomString());

    journalArticle.setContent(RandomTestUtil.randomString());

    journalArticle.setType(RandomTestUtil.randomString());

    journalArticle.setStructureId(RandomTestUtil.randomString());

    journalArticle.setTemplateId(RandomTestUtil.randomString());

    journalArticle.setLayoutUuid(RandomTestUtil.randomString());

    journalArticle.setDisplayDate(RandomTestUtil.nextDate());

    journalArticle.setExpirationDate(RandomTestUtil.nextDate());

    journalArticle.setReviewDate(RandomTestUtil.nextDate());

    journalArticle.setIndexable(RandomTestUtil.randomBoolean());

    journalArticle.setSmallImage(RandomTestUtil.randomBoolean());

    journalArticle.setSmallImageId(RandomTestUtil.nextLong());

    journalArticle.setSmallImageURL(RandomTestUtil.randomString());

    journalArticle.setStatus(RandomTestUtil.nextInt());

    journalArticle.setStatusByUserId(RandomTestUtil.nextLong());

    journalArticle.setStatusByUserName(RandomTestUtil.randomString());

    journalArticle.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(journalArticle);

    return journalArticle;
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    JournalArticle newJournalArticle = _persistence.create(pk);

    newJournalArticle.setUuid(RandomTestUtil.randomString());

    newJournalArticle.setResourcePrimKey(RandomTestUtil.nextLong());

    newJournalArticle.setGroupId(RandomTestUtil.nextLong());

    newJournalArticle.setCompanyId(RandomTestUtil.nextLong());

    newJournalArticle.setUserId(RandomTestUtil.nextLong());

    newJournalArticle.setUserName(RandomTestUtil.randomString());

    newJournalArticle.setCreateDate(RandomTestUtil.nextDate());

    newJournalArticle.setModifiedDate(RandomTestUtil.nextDate());

    newJournalArticle.setFolderId(RandomTestUtil.nextLong());

    newJournalArticle.setClassNameId(RandomTestUtil.nextLong());

    newJournalArticle.setClassPK(RandomTestUtil.nextLong());

    newJournalArticle.setTreePath(RandomTestUtil.randomString());

    newJournalArticle.setArticleId(RandomTestUtil.randomString());

    newJournalArticle.setVersion(RandomTestUtil.nextDouble());

    newJournalArticle.setTitle(RandomTestUtil.randomString());

    newJournalArticle.setUrlTitle(RandomTestUtil.randomString());

    newJournalArticle.setDescription(RandomTestUtil.randomString());

    newJournalArticle.setContent(RandomTestUtil.randomString());

    newJournalArticle.setType(RandomTestUtil.randomString());

    newJournalArticle.setStructureId(RandomTestUtil.randomString());

    newJournalArticle.setTemplateId(RandomTestUtil.randomString());

    newJournalArticle.setLayoutUuid(RandomTestUtil.randomString());

    newJournalArticle.setDisplayDate(RandomTestUtil.nextDate());

    newJournalArticle.setExpirationDate(RandomTestUtil.nextDate());

    newJournalArticle.setReviewDate(RandomTestUtil.nextDate());

    newJournalArticle.setIndexable(RandomTestUtil.randomBoolean());

    newJournalArticle.setSmallImage(RandomTestUtil.randomBoolean());

    newJournalArticle.setSmallImageId(RandomTestUtil.nextLong());

    newJournalArticle.setSmallImageURL(RandomTestUtil.randomString());

    newJournalArticle.setStatus(RandomTestUtil.nextInt());

    newJournalArticle.setStatusByUserId(RandomTestUtil.nextLong());

    newJournalArticle.setStatusByUserName(RandomTestUtil.randomString());

    newJournalArticle.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(newJournalArticle);

    JournalArticle existingJournalArticle =
        _persistence.findByPrimaryKey(newJournalArticle.getPrimaryKey());

    Assert.assertEquals(existingJournalArticle.getUuid(), newJournalArticle.getUuid());
    Assert.assertEquals(existingJournalArticle.getId(), newJournalArticle.getId());
    Assert.assertEquals(
        existingJournalArticle.getResourcePrimKey(), newJournalArticle.getResourcePrimKey());
    Assert.assertEquals(existingJournalArticle.getGroupId(), newJournalArticle.getGroupId());
    Assert.assertEquals(existingJournalArticle.getCompanyId(), newJournalArticle.getCompanyId());
    Assert.assertEquals(existingJournalArticle.getUserId(), newJournalArticle.getUserId());
    Assert.assertEquals(existingJournalArticle.getUserName(), newJournalArticle.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingJournalArticle.getCreateDate()),
        Time.getShortTimestamp(newJournalArticle.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingJournalArticle.getModifiedDate()),
        Time.getShortTimestamp(newJournalArticle.getModifiedDate()));
    Assert.assertEquals(existingJournalArticle.getFolderId(), newJournalArticle.getFolderId());
    Assert.assertEquals(
        existingJournalArticle.getClassNameId(), newJournalArticle.getClassNameId());
    Assert.assertEquals(existingJournalArticle.getClassPK(), newJournalArticle.getClassPK());
    Assert.assertEquals(existingJournalArticle.getTreePath(), newJournalArticle.getTreePath());
    Assert.assertEquals(existingJournalArticle.getArticleId(), newJournalArticle.getArticleId());
    AssertUtils.assertEquals(existingJournalArticle.getVersion(), newJournalArticle.getVersion());
    Assert.assertEquals(existingJournalArticle.getTitle(), newJournalArticle.getTitle());
    Assert.assertEquals(existingJournalArticle.getUrlTitle(), newJournalArticle.getUrlTitle());
    Assert.assertEquals(
        existingJournalArticle.getDescription(), newJournalArticle.getDescription());
    Assert.assertEquals(existingJournalArticle.getContent(), newJournalArticle.getContent());
    Assert.assertEquals(existingJournalArticle.getType(), newJournalArticle.getType());
    Assert.assertEquals(
        existingJournalArticle.getStructureId(), newJournalArticle.getStructureId());
    Assert.assertEquals(existingJournalArticle.getTemplateId(), newJournalArticle.getTemplateId());
    Assert.assertEquals(existingJournalArticle.getLayoutUuid(), newJournalArticle.getLayoutUuid());
    Assert.assertEquals(
        Time.getShortTimestamp(existingJournalArticle.getDisplayDate()),
        Time.getShortTimestamp(newJournalArticle.getDisplayDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingJournalArticle.getExpirationDate()),
        Time.getShortTimestamp(newJournalArticle.getExpirationDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingJournalArticle.getReviewDate()),
        Time.getShortTimestamp(newJournalArticle.getReviewDate()));
    Assert.assertEquals(existingJournalArticle.getIndexable(), newJournalArticle.getIndexable());
    Assert.assertEquals(existingJournalArticle.getSmallImage(), newJournalArticle.getSmallImage());
    Assert.assertEquals(
        existingJournalArticle.getSmallImageId(), newJournalArticle.getSmallImageId());
    Assert.assertEquals(
        existingJournalArticle.getSmallImageURL(), newJournalArticle.getSmallImageURL());
    Assert.assertEquals(existingJournalArticle.getStatus(), newJournalArticle.getStatus());
    Assert.assertEquals(
        existingJournalArticle.getStatusByUserId(), newJournalArticle.getStatusByUserId());
    Assert.assertEquals(
        existingJournalArticle.getStatusByUserName(), newJournalArticle.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingJournalArticle.getStatusDate()),
        Time.getShortTimestamp(newJournalArticle.getStatusDate()));
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    DLFileVersion newDLFileVersion = _persistence.create(pk);

    newDLFileVersion.setUuid(RandomTestUtil.randomString());

    newDLFileVersion.setGroupId(RandomTestUtil.nextLong());

    newDLFileVersion.setCompanyId(RandomTestUtil.nextLong());

    newDLFileVersion.setUserId(RandomTestUtil.nextLong());

    newDLFileVersion.setUserName(RandomTestUtil.randomString());

    newDLFileVersion.setCreateDate(RandomTestUtil.nextDate());

    newDLFileVersion.setModifiedDate(RandomTestUtil.nextDate());

    newDLFileVersion.setRepositoryId(RandomTestUtil.nextLong());

    newDLFileVersion.setFolderId(RandomTestUtil.nextLong());

    newDLFileVersion.setFileEntryId(RandomTestUtil.nextLong());

    newDLFileVersion.setTreePath(RandomTestUtil.randomString());

    newDLFileVersion.setExtension(RandomTestUtil.randomString());

    newDLFileVersion.setMimeType(RandomTestUtil.randomString());

    newDLFileVersion.setTitle(RandomTestUtil.randomString());

    newDLFileVersion.setDescription(RandomTestUtil.randomString());

    newDLFileVersion.setChangeLog(RandomTestUtil.randomString());

    newDLFileVersion.setExtraSettings(RandomTestUtil.randomString());

    newDLFileVersion.setFileEntryTypeId(RandomTestUtil.nextLong());

    newDLFileVersion.setVersion(RandomTestUtil.randomString());

    newDLFileVersion.setSize(RandomTestUtil.nextLong());

    newDLFileVersion.setChecksum(RandomTestUtil.randomString());

    newDLFileVersion.setStatus(RandomTestUtil.nextInt());

    newDLFileVersion.setStatusByUserId(RandomTestUtil.nextLong());

    newDLFileVersion.setStatusByUserName(RandomTestUtil.randomString());

    newDLFileVersion.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(newDLFileVersion);

    DLFileVersion existingDLFileVersion =
        _persistence.findByPrimaryKey(newDLFileVersion.getPrimaryKey());

    Assert.assertEquals(existingDLFileVersion.getUuid(), newDLFileVersion.getUuid());
    Assert.assertEquals(
        existingDLFileVersion.getFileVersionId(), newDLFileVersion.getFileVersionId());
    Assert.assertEquals(existingDLFileVersion.getGroupId(), newDLFileVersion.getGroupId());
    Assert.assertEquals(existingDLFileVersion.getCompanyId(), newDLFileVersion.getCompanyId());
    Assert.assertEquals(existingDLFileVersion.getUserId(), newDLFileVersion.getUserId());
    Assert.assertEquals(existingDLFileVersion.getUserName(), newDLFileVersion.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFileVersion.getCreateDate()),
        Time.getShortTimestamp(newDLFileVersion.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFileVersion.getModifiedDate()),
        Time.getShortTimestamp(newDLFileVersion.getModifiedDate()));
    Assert.assertEquals(
        existingDLFileVersion.getRepositoryId(), newDLFileVersion.getRepositoryId());
    Assert.assertEquals(existingDLFileVersion.getFolderId(), newDLFileVersion.getFolderId());
    Assert.assertEquals(existingDLFileVersion.getFileEntryId(), newDLFileVersion.getFileEntryId());
    Assert.assertEquals(existingDLFileVersion.getTreePath(), newDLFileVersion.getTreePath());
    Assert.assertEquals(existingDLFileVersion.getExtension(), newDLFileVersion.getExtension());
    Assert.assertEquals(existingDLFileVersion.getMimeType(), newDLFileVersion.getMimeType());
    Assert.assertEquals(existingDLFileVersion.getTitle(), newDLFileVersion.getTitle());
    Assert.assertEquals(existingDLFileVersion.getDescription(), newDLFileVersion.getDescription());
    Assert.assertEquals(existingDLFileVersion.getChangeLog(), newDLFileVersion.getChangeLog());
    Assert.assertEquals(
        existingDLFileVersion.getExtraSettings(), newDLFileVersion.getExtraSettings());
    Assert.assertEquals(
        existingDLFileVersion.getFileEntryTypeId(), newDLFileVersion.getFileEntryTypeId());
    Assert.assertEquals(existingDLFileVersion.getVersion(), newDLFileVersion.getVersion());
    Assert.assertEquals(existingDLFileVersion.getSize(), newDLFileVersion.getSize());
    Assert.assertEquals(existingDLFileVersion.getChecksum(), newDLFileVersion.getChecksum());
    Assert.assertEquals(existingDLFileVersion.getStatus(), newDLFileVersion.getStatus());
    Assert.assertEquals(
        existingDLFileVersion.getStatusByUserId(), newDLFileVersion.getStatusByUserId());
    Assert.assertEquals(
        existingDLFileVersion.getStatusByUserName(), newDLFileVersion.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFileVersion.getStatusDate()),
        Time.getShortTimestamp(newDLFileVersion.getStatusDate()));
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    ExportImportConfiguration newExportImportConfiguration = _persistence.create(pk);

    newExportImportConfiguration.setMvccVersion(RandomTestUtil.nextLong());

    newExportImportConfiguration.setGroupId(RandomTestUtil.nextLong());

    newExportImportConfiguration.setCompanyId(RandomTestUtil.nextLong());

    newExportImportConfiguration.setUserId(RandomTestUtil.nextLong());

    newExportImportConfiguration.setUserName(RandomTestUtil.randomString());

    newExportImportConfiguration.setCreateDate(RandomTestUtil.nextDate());

    newExportImportConfiguration.setModifiedDate(RandomTestUtil.nextDate());

    newExportImportConfiguration.setName(RandomTestUtil.randomString());

    newExportImportConfiguration.setDescription(RandomTestUtil.randomString());

    newExportImportConfiguration.setType(RandomTestUtil.nextInt());

    newExportImportConfiguration.setSettings(RandomTestUtil.randomString());

    newExportImportConfiguration.setStatus(RandomTestUtil.nextInt());

    newExportImportConfiguration.setStatusByUserId(RandomTestUtil.nextLong());

    newExportImportConfiguration.setStatusByUserName(RandomTestUtil.randomString());

    newExportImportConfiguration.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(newExportImportConfiguration);

    ExportImportConfiguration existingExportImportConfiguration =
        _persistence.findByPrimaryKey(newExportImportConfiguration.getPrimaryKey());

    Assert.assertEquals(
        existingExportImportConfiguration.getMvccVersion(),
        newExportImportConfiguration.getMvccVersion());
    Assert.assertEquals(
        existingExportImportConfiguration.getExportImportConfigurationId(),
        newExportImportConfiguration.getExportImportConfigurationId());
    Assert.assertEquals(
        existingExportImportConfiguration.getGroupId(), newExportImportConfiguration.getGroupId());
    Assert.assertEquals(
        existingExportImportConfiguration.getCompanyId(),
        newExportImportConfiguration.getCompanyId());
    Assert.assertEquals(
        existingExportImportConfiguration.getUserId(), newExportImportConfiguration.getUserId());
    Assert.assertEquals(
        existingExportImportConfiguration.getUserName(),
        newExportImportConfiguration.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingExportImportConfiguration.getCreateDate()),
        Time.getShortTimestamp(newExportImportConfiguration.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingExportImportConfiguration.getModifiedDate()),
        Time.getShortTimestamp(newExportImportConfiguration.getModifiedDate()));
    Assert.assertEquals(
        existingExportImportConfiguration.getName(), newExportImportConfiguration.getName());
    Assert.assertEquals(
        existingExportImportConfiguration.getDescription(),
        newExportImportConfiguration.getDescription());
    Assert.assertEquals(
        existingExportImportConfiguration.getType(), newExportImportConfiguration.getType());
    Assert.assertEquals(
        existingExportImportConfiguration.getSettings(),
        newExportImportConfiguration.getSettings());
    Assert.assertEquals(
        existingExportImportConfiguration.getStatus(), newExportImportConfiguration.getStatus());
    Assert.assertEquals(
        existingExportImportConfiguration.getStatusByUserId(),
        newExportImportConfiguration.getStatusByUserId());
    Assert.assertEquals(
        existingExportImportConfiguration.getStatusByUserName(),
        newExportImportConfiguration.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingExportImportConfiguration.getStatusDate()),
        Time.getShortTimestamp(newExportImportConfiguration.getStatusDate()));
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    CalEvent newCalEvent = _persistence.create(pk);

    newCalEvent.setUuid(RandomTestUtil.randomString());

    newCalEvent.setGroupId(RandomTestUtil.nextLong());

    newCalEvent.setCompanyId(RandomTestUtil.nextLong());

    newCalEvent.setUserId(RandomTestUtil.nextLong());

    newCalEvent.setUserName(RandomTestUtil.randomString());

    newCalEvent.setCreateDate(RandomTestUtil.nextDate());

    newCalEvent.setModifiedDate(RandomTestUtil.nextDate());

    newCalEvent.setTitle(RandomTestUtil.randomString());

    newCalEvent.setDescription(RandomTestUtil.randomString());

    newCalEvent.setLocation(RandomTestUtil.randomString());

    newCalEvent.setStartDate(RandomTestUtil.nextDate());

    newCalEvent.setEndDate(RandomTestUtil.nextDate());

    newCalEvent.setDurationHour(RandomTestUtil.nextInt());

    newCalEvent.setDurationMinute(RandomTestUtil.nextInt());

    newCalEvent.setAllDay(RandomTestUtil.randomBoolean());

    newCalEvent.setTimeZoneSensitive(RandomTestUtil.randomBoolean());

    newCalEvent.setType(RandomTestUtil.randomString());

    newCalEvent.setRepeating(RandomTestUtil.randomBoolean());

    newCalEvent.setRecurrence(RandomTestUtil.randomString());

    newCalEvent.setRemindBy(RandomTestUtil.nextInt());

    newCalEvent.setFirstReminder(RandomTestUtil.nextInt());

    newCalEvent.setSecondReminder(RandomTestUtil.nextInt());

    _persistence.update(newCalEvent);

    CalEvent existingCalEvent = _persistence.findByPrimaryKey(newCalEvent.getPrimaryKey());

    Assert.assertEquals(existingCalEvent.getUuid(), newCalEvent.getUuid());
    Assert.assertEquals(existingCalEvent.getEventId(), newCalEvent.getEventId());
    Assert.assertEquals(existingCalEvent.getGroupId(), newCalEvent.getGroupId());
    Assert.assertEquals(existingCalEvent.getCompanyId(), newCalEvent.getCompanyId());
    Assert.assertEquals(existingCalEvent.getUserId(), newCalEvent.getUserId());
    Assert.assertEquals(existingCalEvent.getUserName(), newCalEvent.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingCalEvent.getCreateDate()),
        Time.getShortTimestamp(newCalEvent.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingCalEvent.getModifiedDate()),
        Time.getShortTimestamp(newCalEvent.getModifiedDate()));
    Assert.assertEquals(existingCalEvent.getTitle(), newCalEvent.getTitle());
    Assert.assertEquals(existingCalEvent.getDescription(), newCalEvent.getDescription());
    Assert.assertEquals(existingCalEvent.getLocation(), newCalEvent.getLocation());
    Assert.assertEquals(
        Time.getShortTimestamp(existingCalEvent.getStartDate()),
        Time.getShortTimestamp(newCalEvent.getStartDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingCalEvent.getEndDate()),
        Time.getShortTimestamp(newCalEvent.getEndDate()));
    Assert.assertEquals(existingCalEvent.getDurationHour(), newCalEvent.getDurationHour());
    Assert.assertEquals(existingCalEvent.getDurationMinute(), newCalEvent.getDurationMinute());
    Assert.assertEquals(existingCalEvent.getAllDay(), newCalEvent.getAllDay());
    Assert.assertEquals(
        existingCalEvent.getTimeZoneSensitive(), newCalEvent.getTimeZoneSensitive());
    Assert.assertEquals(existingCalEvent.getType(), newCalEvent.getType());
    Assert.assertEquals(existingCalEvent.getRepeating(), newCalEvent.getRepeating());
    Assert.assertEquals(existingCalEvent.getRecurrence(), newCalEvent.getRecurrence());
    Assert.assertEquals(existingCalEvent.getRemindBy(), newCalEvent.getRemindBy());
    Assert.assertEquals(existingCalEvent.getFirstReminder(), newCalEvent.getFirstReminder());
    Assert.assertEquals(existingCalEvent.getSecondReminder(), newCalEvent.getSecondReminder());
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBMessage newMBMessage = _persistence.create(pk);

    newMBMessage.setUuid(RandomTestUtil.randomString());

    newMBMessage.setGroupId(RandomTestUtil.nextLong());

    newMBMessage.setCompanyId(RandomTestUtil.nextLong());

    newMBMessage.setUserId(RandomTestUtil.nextLong());

    newMBMessage.setUserName(RandomTestUtil.randomString());

    newMBMessage.setCreateDate(RandomTestUtil.nextDate());

    newMBMessage.setModifiedDate(RandomTestUtil.nextDate());

    newMBMessage.setClassNameId(RandomTestUtil.nextLong());

    newMBMessage.setClassPK(RandomTestUtil.nextLong());

    newMBMessage.setCategoryId(RandomTestUtil.nextLong());

    newMBMessage.setThreadId(RandomTestUtil.nextLong());

    newMBMessage.setRootMessageId(RandomTestUtil.nextLong());

    newMBMessage.setParentMessageId(RandomTestUtil.nextLong());

    newMBMessage.setSubject(RandomTestUtil.randomString());

    newMBMessage.setBody(RandomTestUtil.randomString());

    newMBMessage.setFormat(RandomTestUtil.randomString());

    newMBMessage.setAnonymous(RandomTestUtil.randomBoolean());

    newMBMessage.setPriority(RandomTestUtil.nextDouble());

    newMBMessage.setAllowPingbacks(RandomTestUtil.randomBoolean());

    newMBMessage.setAnswer(RandomTestUtil.randomBoolean());

    newMBMessage.setStatus(RandomTestUtil.nextInt());

    newMBMessage.setStatusByUserId(RandomTestUtil.nextLong());

    newMBMessage.setStatusByUserName(RandomTestUtil.randomString());

    newMBMessage.setStatusDate(RandomTestUtil.nextDate());

    _mbMessages.add(_persistence.update(newMBMessage));

    MBMessage existingMBMessage = _persistence.findByPrimaryKey(newMBMessage.getPrimaryKey());

    Assert.assertEquals(existingMBMessage.getUuid(), newMBMessage.getUuid());
    Assert.assertEquals(existingMBMessage.getMessageId(), newMBMessage.getMessageId());
    Assert.assertEquals(existingMBMessage.getGroupId(), newMBMessage.getGroupId());
    Assert.assertEquals(existingMBMessage.getCompanyId(), newMBMessage.getCompanyId());
    Assert.assertEquals(existingMBMessage.getUserId(), newMBMessage.getUserId());
    Assert.assertEquals(existingMBMessage.getUserName(), newMBMessage.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBMessage.getCreateDate()),
        Time.getShortTimestamp(newMBMessage.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBMessage.getModifiedDate()),
        Time.getShortTimestamp(newMBMessage.getModifiedDate()));
    Assert.assertEquals(existingMBMessage.getClassNameId(), newMBMessage.getClassNameId());
    Assert.assertEquals(existingMBMessage.getClassPK(), newMBMessage.getClassPK());
    Assert.assertEquals(existingMBMessage.getCategoryId(), newMBMessage.getCategoryId());
    Assert.assertEquals(existingMBMessage.getThreadId(), newMBMessage.getThreadId());
    Assert.assertEquals(existingMBMessage.getRootMessageId(), newMBMessage.getRootMessageId());
    Assert.assertEquals(existingMBMessage.getParentMessageId(), newMBMessage.getParentMessageId());
    Assert.assertEquals(existingMBMessage.getSubject(), newMBMessage.getSubject());
    Assert.assertEquals(existingMBMessage.getBody(), newMBMessage.getBody());
    Assert.assertEquals(existingMBMessage.getFormat(), newMBMessage.getFormat());
    Assert.assertEquals(existingMBMessage.getAnonymous(), newMBMessage.getAnonymous());
    AssertUtils.assertEquals(existingMBMessage.getPriority(), newMBMessage.getPriority());
    Assert.assertEquals(existingMBMessage.getAllowPingbacks(), newMBMessage.getAllowPingbacks());
    Assert.assertEquals(existingMBMessage.getAnswer(), newMBMessage.getAnswer());
    Assert.assertEquals(existingMBMessage.getStatus(), newMBMessage.getStatus());
    Assert.assertEquals(existingMBMessage.getStatusByUserId(), newMBMessage.getStatusByUserId());
    Assert.assertEquals(
        existingMBMessage.getStatusByUserName(), newMBMessage.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBMessage.getStatusDate()),
        Time.getShortTimestamp(newMBMessage.getStatusDate()));
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    WikiNode newWikiNode = _persistence.create(pk);

    newWikiNode.setUuid(RandomTestUtil.randomString());

    newWikiNode.setGroupId(RandomTestUtil.nextLong());

    newWikiNode.setCompanyId(RandomTestUtil.nextLong());

    newWikiNode.setUserId(RandomTestUtil.nextLong());

    newWikiNode.setUserName(RandomTestUtil.randomString());

    newWikiNode.setCreateDate(RandomTestUtil.nextDate());

    newWikiNode.setModifiedDate(RandomTestUtil.nextDate());

    newWikiNode.setName(RandomTestUtil.randomString());

    newWikiNode.setDescription(RandomTestUtil.randomString());

    newWikiNode.setLastPostDate(RandomTestUtil.nextDate());

    newWikiNode.setStatus(RandomTestUtil.nextInt());

    newWikiNode.setStatusByUserId(RandomTestUtil.nextLong());

    newWikiNode.setStatusByUserName(RandomTestUtil.randomString());

    newWikiNode.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(newWikiNode);

    WikiNode existingWikiNode = _persistence.findByPrimaryKey(newWikiNode.getPrimaryKey());

    Assert.assertEquals(existingWikiNode.getUuid(), newWikiNode.getUuid());
    Assert.assertEquals(existingWikiNode.getNodeId(), newWikiNode.getNodeId());
    Assert.assertEquals(existingWikiNode.getGroupId(), newWikiNode.getGroupId());
    Assert.assertEquals(existingWikiNode.getCompanyId(), newWikiNode.getCompanyId());
    Assert.assertEquals(existingWikiNode.getUserId(), newWikiNode.getUserId());
    Assert.assertEquals(existingWikiNode.getUserName(), newWikiNode.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingWikiNode.getCreateDate()),
        Time.getShortTimestamp(newWikiNode.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingWikiNode.getModifiedDate()),
        Time.getShortTimestamp(newWikiNode.getModifiedDate()));
    Assert.assertEquals(existingWikiNode.getName(), newWikiNode.getName());
    Assert.assertEquals(existingWikiNode.getDescription(), newWikiNode.getDescription());
    Assert.assertEquals(
        Time.getShortTimestamp(existingWikiNode.getLastPostDate()),
        Time.getShortTimestamp(newWikiNode.getLastPostDate()));
    Assert.assertEquals(existingWikiNode.getStatus(), newWikiNode.getStatus());
    Assert.assertEquals(existingWikiNode.getStatusByUserId(), newWikiNode.getStatusByUserId());
    Assert.assertEquals(existingWikiNode.getStatusByUserName(), newWikiNode.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingWikiNode.getStatusDate()),
        Time.getShortTimestamp(newWikiNode.getStatusDate()));
  }
  protected Layout addLayout() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Layout layout = _persistence.create(pk);

    layout.setMvccVersion(RandomTestUtil.nextLong());

    layout.setUuid(RandomTestUtil.randomString());

    layout.setGroupId(RandomTestUtil.nextLong());

    layout.setCompanyId(RandomTestUtil.nextLong());

    layout.setUserId(RandomTestUtil.nextLong());

    layout.setUserName(RandomTestUtil.randomString());

    layout.setCreateDate(RandomTestUtil.nextDate());

    layout.setModifiedDate(RandomTestUtil.nextDate());

    layout.setPrivateLayout(RandomTestUtil.randomBoolean());

    layout.setLayoutId(RandomTestUtil.nextLong());

    layout.setParentLayoutId(RandomTestUtil.nextLong());

    layout.setName(RandomTestUtil.randomString());

    layout.setTitle(RandomTestUtil.randomString());

    layout.setDescription(RandomTestUtil.randomString());

    layout.setKeywords(RandomTestUtil.randomString());

    layout.setRobots(RandomTestUtil.randomString());

    layout.setType(RandomTestUtil.randomString());

    layout.setTypeSettings(RandomTestUtil.randomString());

    layout.setHidden(RandomTestUtil.randomBoolean());

    layout.setFriendlyURL(RandomTestUtil.randomString());

    layout.setIconImageId(RandomTestUtil.nextLong());

    layout.setThemeId(RandomTestUtil.randomString());

    layout.setColorSchemeId(RandomTestUtil.randomString());

    layout.setWapThemeId(RandomTestUtil.randomString());

    layout.setWapColorSchemeId(RandomTestUtil.randomString());

    layout.setCss(RandomTestUtil.randomString());

    layout.setPriority(RandomTestUtil.nextInt());

    layout.setLayoutPrototypeUuid(RandomTestUtil.randomString());

    layout.setLayoutPrototypeLinkEnabled(RandomTestUtil.randomBoolean());

    layout.setSourcePrototypeLayoutUuid(RandomTestUtil.randomString());

    _layouts.add(_persistence.update(layout));

    return layout;
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Layout newLayout = _persistence.create(pk);

    newLayout.setMvccVersion(RandomTestUtil.nextLong());

    newLayout.setUuid(RandomTestUtil.randomString());

    newLayout.setGroupId(RandomTestUtil.nextLong());

    newLayout.setCompanyId(RandomTestUtil.nextLong());

    newLayout.setUserId(RandomTestUtil.nextLong());

    newLayout.setUserName(RandomTestUtil.randomString());

    newLayout.setCreateDate(RandomTestUtil.nextDate());

    newLayout.setModifiedDate(RandomTestUtil.nextDate());

    newLayout.setPrivateLayout(RandomTestUtil.randomBoolean());

    newLayout.setLayoutId(RandomTestUtil.nextLong());

    newLayout.setParentLayoutId(RandomTestUtil.nextLong());

    newLayout.setName(RandomTestUtil.randomString());

    newLayout.setTitle(RandomTestUtil.randomString());

    newLayout.setDescription(RandomTestUtil.randomString());

    newLayout.setKeywords(RandomTestUtil.randomString());

    newLayout.setRobots(RandomTestUtil.randomString());

    newLayout.setType(RandomTestUtil.randomString());

    newLayout.setTypeSettings(RandomTestUtil.randomString());

    newLayout.setHidden(RandomTestUtil.randomBoolean());

    newLayout.setFriendlyURL(RandomTestUtil.randomString());

    newLayout.setIconImageId(RandomTestUtil.nextLong());

    newLayout.setThemeId(RandomTestUtil.randomString());

    newLayout.setColorSchemeId(RandomTestUtil.randomString());

    newLayout.setWapThemeId(RandomTestUtil.randomString());

    newLayout.setWapColorSchemeId(RandomTestUtil.randomString());

    newLayout.setCss(RandomTestUtil.randomString());

    newLayout.setPriority(RandomTestUtil.nextInt());

    newLayout.setLayoutPrototypeUuid(RandomTestUtil.randomString());

    newLayout.setLayoutPrototypeLinkEnabled(RandomTestUtil.randomBoolean());

    newLayout.setSourcePrototypeLayoutUuid(RandomTestUtil.randomString());

    _layouts.add(_persistence.update(newLayout));

    Layout existingLayout = _persistence.findByPrimaryKey(newLayout.getPrimaryKey());

    Assert.assertEquals(existingLayout.getMvccVersion(), newLayout.getMvccVersion());
    Assert.assertEquals(existingLayout.getUuid(), newLayout.getUuid());
    Assert.assertEquals(existingLayout.getPlid(), newLayout.getPlid());
    Assert.assertEquals(existingLayout.getGroupId(), newLayout.getGroupId());
    Assert.assertEquals(existingLayout.getCompanyId(), newLayout.getCompanyId());
    Assert.assertEquals(existingLayout.getUserId(), newLayout.getUserId());
    Assert.assertEquals(existingLayout.getUserName(), newLayout.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingLayout.getCreateDate()),
        Time.getShortTimestamp(newLayout.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingLayout.getModifiedDate()),
        Time.getShortTimestamp(newLayout.getModifiedDate()));
    Assert.assertEquals(existingLayout.getPrivateLayout(), newLayout.getPrivateLayout());
    Assert.assertEquals(existingLayout.getLayoutId(), newLayout.getLayoutId());
    Assert.assertEquals(existingLayout.getParentLayoutId(), newLayout.getParentLayoutId());
    Assert.assertEquals(existingLayout.getName(), newLayout.getName());
    Assert.assertEquals(existingLayout.getTitle(), newLayout.getTitle());
    Assert.assertEquals(existingLayout.getDescription(), newLayout.getDescription());
    Assert.assertEquals(existingLayout.getKeywords(), newLayout.getKeywords());
    Assert.assertEquals(existingLayout.getRobots(), newLayout.getRobots());
    Assert.assertEquals(existingLayout.getType(), newLayout.getType());
    Assert.assertEquals(existingLayout.getTypeSettings(), newLayout.getTypeSettings());
    Assert.assertEquals(existingLayout.getHidden(), newLayout.getHidden());
    Assert.assertEquals(existingLayout.getFriendlyURL(), newLayout.getFriendlyURL());
    Assert.assertEquals(existingLayout.getIconImageId(), newLayout.getIconImageId());
    Assert.assertEquals(existingLayout.getThemeId(), newLayout.getThemeId());
    Assert.assertEquals(existingLayout.getColorSchemeId(), newLayout.getColorSchemeId());
    Assert.assertEquals(existingLayout.getWapThemeId(), newLayout.getWapThemeId());
    Assert.assertEquals(existingLayout.getWapColorSchemeId(), newLayout.getWapColorSchemeId());
    Assert.assertEquals(existingLayout.getCss(), newLayout.getCss());
    Assert.assertEquals(existingLayout.getPriority(), newLayout.getPriority());
    Assert.assertEquals(
        existingLayout.getLayoutPrototypeUuid(), newLayout.getLayoutPrototypeUuid());
    Assert.assertEquals(
        existingLayout.getLayoutPrototypeLinkEnabled(), newLayout.getLayoutPrototypeLinkEnabled());
    Assert.assertEquals(
        existingLayout.getSourcePrototypeLayoutUuid(), newLayout.getSourcePrototypeLayoutUuid());
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    DLFolder newDLFolder = _persistence.create(pk);

    newDLFolder.setUuid(RandomTestUtil.randomString());

    newDLFolder.setGroupId(RandomTestUtil.nextLong());

    newDLFolder.setCompanyId(RandomTestUtil.nextLong());

    newDLFolder.setUserId(RandomTestUtil.nextLong());

    newDLFolder.setUserName(RandomTestUtil.randomString());

    newDLFolder.setCreateDate(RandomTestUtil.nextDate());

    newDLFolder.setModifiedDate(RandomTestUtil.nextDate());

    newDLFolder.setRepositoryId(RandomTestUtil.nextLong());

    newDLFolder.setMountPoint(RandomTestUtil.randomBoolean());

    newDLFolder.setParentFolderId(RandomTestUtil.nextLong());

    newDLFolder.setTreePath(RandomTestUtil.randomString());

    newDLFolder.setName(RandomTestUtil.randomString());

    newDLFolder.setDescription(RandomTestUtil.randomString());

    newDLFolder.setLastPostDate(RandomTestUtil.nextDate());

    newDLFolder.setDefaultFileEntryTypeId(RandomTestUtil.nextLong());

    newDLFolder.setHidden(RandomTestUtil.randomBoolean());

    newDLFolder.setOverrideFileEntryTypes(RandomTestUtil.randomBoolean());

    newDLFolder.setStatus(RandomTestUtil.nextInt());

    newDLFolder.setStatusByUserId(RandomTestUtil.nextLong());

    newDLFolder.setStatusByUserName(RandomTestUtil.randomString());

    newDLFolder.setStatusDate(RandomTestUtil.nextDate());

    _persistence.update(newDLFolder);

    DLFolder existingDLFolder = _persistence.findByPrimaryKey(newDLFolder.getPrimaryKey());

    Assert.assertEquals(existingDLFolder.getUuid(), newDLFolder.getUuid());
    Assert.assertEquals(existingDLFolder.getFolderId(), newDLFolder.getFolderId());
    Assert.assertEquals(existingDLFolder.getGroupId(), newDLFolder.getGroupId());
    Assert.assertEquals(existingDLFolder.getCompanyId(), newDLFolder.getCompanyId());
    Assert.assertEquals(existingDLFolder.getUserId(), newDLFolder.getUserId());
    Assert.assertEquals(existingDLFolder.getUserName(), newDLFolder.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFolder.getCreateDate()),
        Time.getShortTimestamp(newDLFolder.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFolder.getModifiedDate()),
        Time.getShortTimestamp(newDLFolder.getModifiedDate()));
    Assert.assertEquals(existingDLFolder.getRepositoryId(), newDLFolder.getRepositoryId());
    Assert.assertEquals(existingDLFolder.getMountPoint(), newDLFolder.getMountPoint());
    Assert.assertEquals(existingDLFolder.getParentFolderId(), newDLFolder.getParentFolderId());
    Assert.assertEquals(existingDLFolder.getTreePath(), newDLFolder.getTreePath());
    Assert.assertEquals(existingDLFolder.getName(), newDLFolder.getName());
    Assert.assertEquals(existingDLFolder.getDescription(), newDLFolder.getDescription());
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFolder.getLastPostDate()),
        Time.getShortTimestamp(newDLFolder.getLastPostDate()));
    Assert.assertEquals(
        existingDLFolder.getDefaultFileEntryTypeId(), newDLFolder.getDefaultFileEntryTypeId());
    Assert.assertEquals(existingDLFolder.getHidden(), newDLFolder.getHidden());
    Assert.assertEquals(
        existingDLFolder.getOverrideFileEntryTypes(), newDLFolder.getOverrideFileEntryTypes());
    Assert.assertEquals(existingDLFolder.getStatus(), newDLFolder.getStatus());
    Assert.assertEquals(existingDLFolder.getStatusByUserId(), newDLFolder.getStatusByUserId());
    Assert.assertEquals(existingDLFolder.getStatusByUserName(), newDLFolder.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFolder.getStatusDate()),
        Time.getShortTimestamp(newDLFolder.getStatusDate()));
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    DLFileShortcut newDLFileShortcut = _persistence.create(pk);

    newDLFileShortcut.setUuid(RandomTestUtil.randomString());

    newDLFileShortcut.setGroupId(RandomTestUtil.nextLong());

    newDLFileShortcut.setCompanyId(RandomTestUtil.nextLong());

    newDLFileShortcut.setUserId(RandomTestUtil.nextLong());

    newDLFileShortcut.setUserName(RandomTestUtil.randomString());

    newDLFileShortcut.setCreateDate(RandomTestUtil.nextDate());

    newDLFileShortcut.setModifiedDate(RandomTestUtil.nextDate());

    newDLFileShortcut.setRepositoryId(RandomTestUtil.nextLong());

    newDLFileShortcut.setFolderId(RandomTestUtil.nextLong());

    newDLFileShortcut.setToFileEntryId(RandomTestUtil.nextLong());

    newDLFileShortcut.setTreePath(RandomTestUtil.randomString());

    newDLFileShortcut.setActive(RandomTestUtil.randomBoolean());

    newDLFileShortcut.setStatus(RandomTestUtil.nextInt());

    newDLFileShortcut.setStatusByUserId(RandomTestUtil.nextLong());

    newDLFileShortcut.setStatusByUserName(RandomTestUtil.randomString());

    newDLFileShortcut.setStatusDate(RandomTestUtil.nextDate());

    _dlFileShortcuts.add(_persistence.update(newDLFileShortcut));

    DLFileShortcut existingDLFileShortcut =
        _persistence.findByPrimaryKey(newDLFileShortcut.getPrimaryKey());

    Assert.assertEquals(existingDLFileShortcut.getUuid(), newDLFileShortcut.getUuid());
    Assert.assertEquals(
        existingDLFileShortcut.getFileShortcutId(), newDLFileShortcut.getFileShortcutId());
    Assert.assertEquals(existingDLFileShortcut.getGroupId(), newDLFileShortcut.getGroupId());
    Assert.assertEquals(existingDLFileShortcut.getCompanyId(), newDLFileShortcut.getCompanyId());
    Assert.assertEquals(existingDLFileShortcut.getUserId(), newDLFileShortcut.getUserId());
    Assert.assertEquals(existingDLFileShortcut.getUserName(), newDLFileShortcut.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFileShortcut.getCreateDate()),
        Time.getShortTimestamp(newDLFileShortcut.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFileShortcut.getModifiedDate()),
        Time.getShortTimestamp(newDLFileShortcut.getModifiedDate()));
    Assert.assertEquals(
        existingDLFileShortcut.getRepositoryId(), newDLFileShortcut.getRepositoryId());
    Assert.assertEquals(existingDLFileShortcut.getFolderId(), newDLFileShortcut.getFolderId());
    Assert.assertEquals(
        existingDLFileShortcut.getToFileEntryId(), newDLFileShortcut.getToFileEntryId());
    Assert.assertEquals(existingDLFileShortcut.getTreePath(), newDLFileShortcut.getTreePath());
    Assert.assertEquals(existingDLFileShortcut.getActive(), newDLFileShortcut.getActive());
    Assert.assertEquals(existingDLFileShortcut.getStatus(), newDLFileShortcut.getStatus());
    Assert.assertEquals(
        existingDLFileShortcut.getStatusByUserId(), newDLFileShortcut.getStatusByUserId());
    Assert.assertEquals(
        existingDLFileShortcut.getStatusByUserName(), newDLFileShortcut.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingDLFileShortcut.getStatusDate()),
        Time.getShortTimestamp(newDLFileShortcut.getStatusDate()));
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MBThread newMBThread = _persistence.create(pk);

    newMBThread.setUuid(RandomTestUtil.randomString());

    newMBThread.setGroupId(RandomTestUtil.nextLong());

    newMBThread.setCompanyId(RandomTestUtil.nextLong());

    newMBThread.setUserId(RandomTestUtil.nextLong());

    newMBThread.setUserName(RandomTestUtil.randomString());

    newMBThread.setCreateDate(RandomTestUtil.nextDate());

    newMBThread.setModifiedDate(RandomTestUtil.nextDate());

    newMBThread.setCategoryId(RandomTestUtil.nextLong());

    newMBThread.setRootMessageId(RandomTestUtil.nextLong());

    newMBThread.setRootMessageUserId(RandomTestUtil.nextLong());

    newMBThread.setMessageCount(RandomTestUtil.nextInt());

    newMBThread.setViewCount(RandomTestUtil.nextInt());

    newMBThread.setLastPostByUserId(RandomTestUtil.nextLong());

    newMBThread.setLastPostDate(RandomTestUtil.nextDate());

    newMBThread.setPriority(RandomTestUtil.nextDouble());

    newMBThread.setQuestion(RandomTestUtil.randomBoolean());

    newMBThread.setStatus(RandomTestUtil.nextInt());

    newMBThread.setStatusByUserId(RandomTestUtil.nextLong());

    newMBThread.setStatusByUserName(RandomTestUtil.randomString());

    newMBThread.setStatusDate(RandomTestUtil.nextDate());

    _mbThreads.add(_persistence.update(newMBThread));

    MBThread existingMBThread = _persistence.findByPrimaryKey(newMBThread.getPrimaryKey());

    Assert.assertEquals(existingMBThread.getUuid(), newMBThread.getUuid());
    Assert.assertEquals(existingMBThread.getThreadId(), newMBThread.getThreadId());
    Assert.assertEquals(existingMBThread.getGroupId(), newMBThread.getGroupId());
    Assert.assertEquals(existingMBThread.getCompanyId(), newMBThread.getCompanyId());
    Assert.assertEquals(existingMBThread.getUserId(), newMBThread.getUserId());
    Assert.assertEquals(existingMBThread.getUserName(), newMBThread.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBThread.getCreateDate()),
        Time.getShortTimestamp(newMBThread.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBThread.getModifiedDate()),
        Time.getShortTimestamp(newMBThread.getModifiedDate()));
    Assert.assertEquals(existingMBThread.getCategoryId(), newMBThread.getCategoryId());
    Assert.assertEquals(existingMBThread.getRootMessageId(), newMBThread.getRootMessageId());
    Assert.assertEquals(
        existingMBThread.getRootMessageUserId(), newMBThread.getRootMessageUserId());
    Assert.assertEquals(existingMBThread.getMessageCount(), newMBThread.getMessageCount());
    Assert.assertEquals(existingMBThread.getViewCount(), newMBThread.getViewCount());
    Assert.assertEquals(existingMBThread.getLastPostByUserId(), newMBThread.getLastPostByUserId());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBThread.getLastPostDate()),
        Time.getShortTimestamp(newMBThread.getLastPostDate()));
    AssertUtils.assertEquals(existingMBThread.getPriority(), newMBThread.getPriority());
    Assert.assertEquals(existingMBThread.getQuestion(), newMBThread.getQuestion());
    Assert.assertEquals(existingMBThread.getStatus(), newMBThread.getStatus());
    Assert.assertEquals(existingMBThread.getStatusByUserId(), newMBThread.getStatusByUserId());
    Assert.assertEquals(existingMBThread.getStatusByUserName(), newMBThread.getStatusByUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMBThread.getStatusDate()),
        Time.getShortTimestamp(newMBThread.getStatusDate()));
  }