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 testCountByTempImage() {
    try {
      _persistence.countByTempImage(RandomTestUtil.randomBoolean());

      _persistence.countByTempImage(RandomTestUtil.randomBoolean());
    } catch (Exception e) {
      Assert.fail(e.getMessage());
    }
  }
  @Test
  public void testCountByG_R() {
    try {
      _persistence.countByG_R(RandomTestUtil.nextLong(), RandomTestUtil.randomBoolean());

      _persistence.countByG_R(0L, RandomTestUtil.randomBoolean());
    } 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;
  }
  @Test
  public void testCountByG_T_R() {
    try {
      _persistence.countByG_T_R(
          RandomTestUtil.nextLong(), StringPool.BLANK, RandomTestUtil.randomBoolean());

      _persistence.countByG_T_R(0L, StringPool.NULL, RandomTestUtil.randomBoolean());

      _persistence.countByG_T_R(0L, (String) null, RandomTestUtil.randomBoolean());
    } catch (Exception e) {
      Assert.fail(e.getMessage());
    }
  }
  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;
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Region newRegion = _persistence.create(pk);

    newRegion.setMvccVersion(RandomTestUtil.nextLong());

    newRegion.setCountryId(RandomTestUtil.nextLong());

    newRegion.setRegionCode(RandomTestUtil.randomString());

    newRegion.setName(RandomTestUtil.randomString());

    newRegion.setActive(RandomTestUtil.randomBoolean());

    _persistence.update(newRegion);

    Region existingRegion = _persistence.findByPrimaryKey(newRegion.getPrimaryKey());

    Assert.assertEquals(existingRegion.getMvccVersion(), newRegion.getMvccVersion());
    Assert.assertEquals(existingRegion.getRegionId(), newRegion.getRegionId());
    Assert.assertEquals(existingRegion.getCountryId(), newRegion.getCountryId());
    Assert.assertEquals(existingRegion.getRegionCode(), newRegion.getRegionCode());
    Assert.assertEquals(existingRegion.getName(), newRegion.getName());
    Assert.assertEquals(existingRegion.getActive(), newRegion.getActive());
  }
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Portlet newPortlet = _persistence.create(pk);

    newPortlet.setMvccVersion(RandomTestUtil.nextLong());

    newPortlet.setCompanyId(RandomTestUtil.nextLong());

    newPortlet.setPortletId(RandomTestUtil.randomString());

    newPortlet.setRoles(RandomTestUtil.randomString());

    newPortlet.setActive(RandomTestUtil.randomBoolean());

    _persistence.update(newPortlet);

    Portlet existingPortlet = _persistence.findByPrimaryKey(newPortlet.getPrimaryKey());

    Assert.assertEquals(existingPortlet.getMvccVersion(), newPortlet.getMvccVersion());
    Assert.assertEquals(existingPortlet.getId(), newPortlet.getId());
    Assert.assertEquals(existingPortlet.getCompanyId(), newPortlet.getCompanyId());
    Assert.assertEquals(existingPortlet.getPortletId(), newPortlet.getPortletId());
    Assert.assertEquals(existingPortlet.getRoles(), newPortlet.getRoles());
    Assert.assertEquals(existingPortlet.getActive(), newPortlet.getActive());
  }
 @Test
 public void testCountByR_I_SArrayable() {
   try {
     _persistence.countByR_I_S(
         RandomTestUtil.nextLong(),
         RandomTestUtil.randomBoolean(),
         new int[] {RandomTestUtil.nextInt(), 0});
   } catch (Exception e) {
     Assert.fail(e.getMessage());
   }
 }
 @Test
 public void testCountByG_T_RArrayable() {
   try {
     _persistence.countByG_T_R(
         RandomTestUtil.nextLong(),
         new String[] {
           RandomTestUtil.randomString(), StringPool.BLANK, StringPool.NULL, null, null
         },
         RandomTestUtil.randomBoolean());
   } catch (Exception e) {
     Assert.fail(e.getMessage());
   }
 }
  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();

    JournalArticleImage newJournalArticleImage = _persistence.create(pk);

    newJournalArticleImage.setGroupId(RandomTestUtil.nextLong());

    newJournalArticleImage.setArticleId(RandomTestUtil.randomString());

    newJournalArticleImage.setVersion(RandomTestUtil.nextDouble());

    newJournalArticleImage.setElInstanceId(RandomTestUtil.randomString());

    newJournalArticleImage.setElName(RandomTestUtil.randomString());

    newJournalArticleImage.setLanguageId(RandomTestUtil.randomString());

    newJournalArticleImage.setTempImage(RandomTestUtil.randomBoolean());

    _journalArticleImages.add(_persistence.update(newJournalArticleImage));

    JournalArticleImage existingJournalArticleImage =
        _persistence.findByPrimaryKey(newJournalArticleImage.getPrimaryKey());

    Assert.assertEquals(
        existingJournalArticleImage.getArticleImageId(),
        newJournalArticleImage.getArticleImageId());
    Assert.assertEquals(
        existingJournalArticleImage.getGroupId(), newJournalArticleImage.getGroupId());
    Assert.assertEquals(
        existingJournalArticleImage.getArticleId(), newJournalArticleImage.getArticleId());
    AssertUtils.assertEquals(
        existingJournalArticleImage.getVersion(), newJournalArticleImage.getVersion());
    Assert.assertEquals(
        existingJournalArticleImage.getElInstanceId(), newJournalArticleImage.getElInstanceId());
    Assert.assertEquals(
        existingJournalArticleImage.getElName(), newJournalArticleImage.getElName());
    Assert.assertEquals(
        existingJournalArticleImage.getLanguageId(), newJournalArticleImage.getLanguageId());
    Assert.assertEquals(
        existingJournalArticleImage.getTempImage(), newJournalArticleImage.getTempImage());
  }
  protected Portlet addPortlet() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Portlet portlet = _persistence.create(pk);

    portlet.setMvccVersion(RandomTestUtil.nextLong());

    portlet.setCompanyId(RandomTestUtil.nextLong());

    portlet.setPortletId(RandomTestUtil.randomString());

    portlet.setRoles(RandomTestUtil.randomString());

    portlet.setActive(RandomTestUtil.randomBoolean());

    _persistence.update(portlet);

    return portlet;
  }
  protected Region addRegion() throws Exception {
    long pk = RandomTestUtil.nextLong();

    Region region = _persistence.create(pk);

    region.setMvccVersion(RandomTestUtil.nextLong());

    region.setCountryId(RandomTestUtil.nextLong());

    region.setRegionCode(RandomTestUtil.randomString());

    region.setName(RandomTestUtil.randomString());

    region.setActive(RandomTestUtil.randomBoolean());

    _persistence.update(region);

    return region;
  }
  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;
  }
  protected JournalArticleImage addJournalArticleImage() throws Exception {
    long pk = RandomTestUtil.nextLong();

    JournalArticleImage journalArticleImage = _persistence.create(pk);

    journalArticleImage.setGroupId(RandomTestUtil.nextLong());

    journalArticleImage.setArticleId(RandomTestUtil.randomString());

    journalArticleImage.setVersion(RandomTestUtil.nextDouble());

    journalArticleImage.setElInstanceId(RandomTestUtil.randomString());

    journalArticleImage.setElName(RandomTestUtil.randomString());

    journalArticleImage.setLanguageId(RandomTestUtil.randomString());

    journalArticleImage.setTempImage(RandomTestUtil.randomBoolean());

    _journalArticleImages.add(_persistence.update(journalArticleImage));

    return journalArticleImage;
  }
  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();

    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()));
  }
  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();

    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()));
  }
  @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());
  }
  @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()));
  }