コード例 #1
0
  protected LayoutSet toUnwrappedModel(LayoutSet layoutSet) {
    if (layoutSet instanceof LayoutSetImpl) {
      return layoutSet;
    }

    LayoutSetImpl layoutSetImpl = new LayoutSetImpl();

    layoutSetImpl.setNew(layoutSet.isNew());
    layoutSetImpl.setPrimaryKey(layoutSet.getPrimaryKey());

    layoutSetImpl.setLayoutSetId(layoutSet.getLayoutSetId());
    layoutSetImpl.setGroupId(layoutSet.getGroupId());
    layoutSetImpl.setCompanyId(layoutSet.getCompanyId());
    layoutSetImpl.setPrivateLayout(layoutSet.isPrivateLayout());
    layoutSetImpl.setLogo(layoutSet.isLogo());
    layoutSetImpl.setLogoId(layoutSet.getLogoId());
    layoutSetImpl.setThemeId(layoutSet.getThemeId());
    layoutSetImpl.setColorSchemeId(layoutSet.getColorSchemeId());
    layoutSetImpl.setWapThemeId(layoutSet.getWapThemeId());
    layoutSetImpl.setWapColorSchemeId(layoutSet.getWapColorSchemeId());
    layoutSetImpl.setCss(layoutSet.getCss());
    layoutSetImpl.setPageCount(layoutSet.getPageCount());
    layoutSetImpl.setSettings(layoutSet.getSettings());
    layoutSetImpl.setLayoutSetPrototypeId(layoutSet.getLayoutSetPrototypeId());

    return layoutSetImpl;
  }
コード例 #2
0
  @Test
  public void testUpdateExisting() throws Exception {
    long pk = RandomTestUtil.nextLong();

    LayoutSet newLayoutSet = _persistence.create(pk);

    newLayoutSet.setMvccVersion(RandomTestUtil.nextLong());

    newLayoutSet.setGroupId(RandomTestUtil.nextLong());

    newLayoutSet.setCompanyId(RandomTestUtil.nextLong());

    newLayoutSet.setCreateDate(RandomTestUtil.nextDate());

    newLayoutSet.setModifiedDate(RandomTestUtil.nextDate());

    newLayoutSet.setPrivateLayout(RandomTestUtil.randomBoolean());

    newLayoutSet.setLogoId(RandomTestUtil.nextLong());

    newLayoutSet.setThemeId(RandomTestUtil.randomString());

    newLayoutSet.setColorSchemeId(RandomTestUtil.randomString());

    newLayoutSet.setWapThemeId(RandomTestUtil.randomString());

    newLayoutSet.setWapColorSchemeId(RandomTestUtil.randomString());

    newLayoutSet.setCss(RandomTestUtil.randomString());

    newLayoutSet.setPageCount(RandomTestUtil.nextInt());

    newLayoutSet.setSettings(RandomTestUtil.randomString());

    newLayoutSet.setLayoutSetPrototypeUuid(RandomTestUtil.randomString());

    newLayoutSet.setLayoutSetPrototypeLinkEnabled(RandomTestUtil.randomBoolean());

    _layoutSets.add(_persistence.update(newLayoutSet));

    LayoutSet existingLayoutSet = _persistence.findByPrimaryKey(newLayoutSet.getPrimaryKey());

    Assert.assertEquals(existingLayoutSet.getMvccVersion(), newLayoutSet.getMvccVersion());
    Assert.assertEquals(existingLayoutSet.getLayoutSetId(), newLayoutSet.getLayoutSetId());
    Assert.assertEquals(existingLayoutSet.getGroupId(), newLayoutSet.getGroupId());
    Assert.assertEquals(existingLayoutSet.getCompanyId(), newLayoutSet.getCompanyId());
    Assert.assertEquals(
        Time.getShortTimestamp(existingLayoutSet.getCreateDate()),
        Time.getShortTimestamp(newLayoutSet.getCreateDate()));
    Assert.assertEquals(
        Time.getShortTimestamp(existingLayoutSet.getModifiedDate()),
        Time.getShortTimestamp(newLayoutSet.getModifiedDate()));
    Assert.assertEquals(existingLayoutSet.getPrivateLayout(), newLayoutSet.getPrivateLayout());
    Assert.assertEquals(existingLayoutSet.getLogoId(), newLayoutSet.getLogoId());
    Assert.assertEquals(existingLayoutSet.getThemeId(), newLayoutSet.getThemeId());
    Assert.assertEquals(existingLayoutSet.getColorSchemeId(), newLayoutSet.getColorSchemeId());
    Assert.assertEquals(existingLayoutSet.getWapThemeId(), newLayoutSet.getWapThemeId());
    Assert.assertEquals(
        existingLayoutSet.getWapColorSchemeId(), newLayoutSet.getWapColorSchemeId());
    Assert.assertEquals(existingLayoutSet.getCss(), newLayoutSet.getCss());
    Assert.assertEquals(existingLayoutSet.getPageCount(), newLayoutSet.getPageCount());
    Assert.assertEquals(existingLayoutSet.getSettings(), newLayoutSet.getSettings());
    Assert.assertEquals(
        existingLayoutSet.getLayoutSetPrototypeUuid(), newLayoutSet.getLayoutSetPrototypeUuid());
    Assert.assertEquals(
        existingLayoutSet.getLayoutSetPrototypeLinkEnabled(),
        newLayoutSet.getLayoutSetPrototypeLinkEnabled());
  }