protected MeetupsRegistration addMeetupsRegistration() throws Exception {
    long pk = RandomTestUtil.nextLong();

    MeetupsRegistration meetupsRegistration = _persistence.create(pk);

    meetupsRegistration.setCompanyId(RandomTestUtil.nextLong());

    meetupsRegistration.setUserId(RandomTestUtil.nextLong());

    meetupsRegistration.setUserName(RandomTestUtil.randomString());

    meetupsRegistration.setCreateDate(RandomTestUtil.nextDate());

    meetupsRegistration.setModifiedDate(RandomTestUtil.nextDate());

    meetupsRegistration.setMeetupsEntryId(RandomTestUtil.nextLong());

    meetupsRegistration.setStatus(RandomTestUtil.nextInt());

    meetupsRegistration.setComments(RandomTestUtil.randomString());

    _meetupsRegistrations.add(_persistence.update(meetupsRegistration));

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

    MeetupsRegistration newMeetupsRegistration = _persistence.create(pk);

    newMeetupsRegistration.setCompanyId(RandomTestUtil.nextLong());

    newMeetupsRegistration.setUserId(RandomTestUtil.nextLong());

    newMeetupsRegistration.setUserName(RandomTestUtil.randomString());

    newMeetupsRegistration.setCreateDate(RandomTestUtil.nextDate());

    newMeetupsRegistration.setModifiedDate(RandomTestUtil.nextDate());

    newMeetupsRegistration.setMeetupsEntryId(RandomTestUtil.nextLong());

    newMeetupsRegistration.setStatus(RandomTestUtil.nextInt());

    newMeetupsRegistration.setComments(RandomTestUtil.randomString());

    _meetupsRegistrations.add(_persistence.update(newMeetupsRegistration));

    MeetupsRegistration existingMeetupsRegistration =
        _persistence.findByPrimaryKey(newMeetupsRegistration.getPrimaryKey());

    Assert.assertEquals(
        existingMeetupsRegistration.getMeetupsRegistrationId(),
        newMeetupsRegistration.getMeetupsRegistrationId());
    Assert.assertEquals(
        existingMeetupsRegistration.getCompanyId(), newMeetupsRegistration.getCompanyId());
    Assert.assertEquals(
        existingMeetupsRegistration.getUserId(), newMeetupsRegistration.getUserId());
    Assert.assertEquals(
        existingMeetupsRegistration.getUserName(), newMeetupsRegistration.getUserName());
    Assert.assertEquals(
        Time.getShortTimestamp(existingMeetupsRegistration.getCreateDate()),
        Time.getShortTimestamp(newMeetupsRegistration.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingMeetupsRegistration.getModifiedDate()),
        Time.getShortTimestamp(newMeetupsRegistration.getModifiedDate()));
    Assert.assertEquals(
        existingMeetupsRegistration.getMeetupsEntryId(),
        newMeetupsRegistration.getMeetupsEntryId());
    Assert.assertEquals(
        existingMeetupsRegistration.getStatus(), newMeetupsRegistration.getStatus());
    Assert.assertEquals(
        existingMeetupsRegistration.getComments(), newMeetupsRegistration.getComments());
  }