Package org.apache.ambari.server.orm.entities

Examples of org.apache.ambari.server.orm.entities.ViewInstanceDataEntity


        viewInstancePropertyEntity.setValue((String) entry.getValue());
        viewInstancePropertyEntity.setViewInstanceEntity(viewInstanceEntity);

        instanceProperties.add(viewInstancePropertyEntity);
      } else if (propertyName.startsWith(DATA_PREFIX)) {
        ViewInstanceDataEntity viewInstanceDataEntity = new ViewInstanceDataEntity();

        viewInstanceDataEntity.setViewName(viewName);
        viewInstanceDataEntity.setViewInstanceName(name);
        viewInstanceDataEntity.setName(entry.getKey().substring(DATA_PREFIX.length()));
        viewInstanceDataEntity.setValue((String) entry.getValue());
        viewInstanceDataEntity.setViewInstanceEntity(viewInstanceEntity);

        instanceData.add(viewInstanceDataEntity);
      }
    }
    viewInstanceEntity.setProperties(instanceProperties);
View Full Code Here


        viewInstancePropertyEntity.setValue((String) entry.getValue());
        viewInstancePropertyEntity.setViewInstanceEntity(viewInstanceEntity);

        instanceProperties.add(viewInstancePropertyEntity);
      } else if (propertyName.startsWith(DATA_PREFIX)) {
        ViewInstanceDataEntity viewInstanceDataEntity = new ViewInstanceDataEntity();

        viewInstanceDataEntity.setViewName(viewName);
        viewInstanceDataEntity.setViewInstanceName(name);
        viewInstanceDataEntity.setName(entry.getKey().substring(DATA_PREFIX.length()));
        viewInstanceDataEntity.setValue((String) entry.getValue());
        viewInstanceDataEntity.setViewInstanceEntity(viewInstanceEntity);

        instanceData.add(viewInstanceDataEntity);
      }
    }
    if (!instanceProperties.isEmpty()) {
View Full Code Here

    replay(entityManagerProvider);
  }

  @Test
  public void testMergeData() throws Exception {
    ViewInstanceDataEntity entity = new ViewInstanceDataEntity();
    ViewInstanceDataEntity entity2 = new ViewInstanceDataEntity();

    // set expectations
    expect(entityManager.merge(eq(entity))).andReturn(entity2);
    replay(entityManager);
View Full Code Here

    verify(entityManagerProvider, entityManager);
  }

  @Test
  public void testRemoveData() throws Exception {
    ViewInstanceDataEntity entity = new ViewInstanceDataEntity();
    ViewInstanceDataEntity entity2 = new ViewInstanceDataEntity();

    // set expectations
    expect(entityManager.merge(eq(entity))).andReturn(entity2);
    entityManager.remove(eq(entity2));
    replay(entityManager);
View Full Code Here

    ViewInstanceEntity viewInstanceEntity = ViewInstanceEntityTest.getViewInstanceEntity();

    viewInstanceEntity.putInstanceData("foo", "value");

    ViewInstanceDataEntity dataEntity = viewInstanceEntity.getInstanceData("foo");

    viewInstanceDAO.removeData(dataEntity);
    expect(viewInstanceDAO.merge(viewInstanceEntity)).andReturn(viewInstanceEntity);
    replay(viewDAO, viewInstanceDAO);
View Full Code Here

   *
   * @param instanceEntity  the instance entity
   * @param key             the data key
   */
  public void removeInstanceData(ViewInstanceEntity instanceEntity, String key) {
    ViewInstanceDataEntity dataEntity = instanceEntity.getInstanceData(key);
    if (dataEntity != null) {
      instanceDAO.removeData(dataEntity);
    }
    instanceEntity.removeInstanceData(key);
    instanceDAO.merge(instanceEntity);
View Full Code Here

    ViewInstanceEntity viewInstanceEntity = ViewInstanceEntityTest.getViewInstanceEntity();

    viewInstanceEntity.putInstanceData("foo", "value");

    ViewInstanceDataEntity dataEntity = viewInstanceEntity.getInstanceData("foo");

    viewInstanceDAO.removeData(dataEntity);
    expect(viewInstanceDAO.merge(viewInstanceEntity)).andReturn(viewInstanceEntity);
    replay(viewDAO, viewInstanceDAO);
View Full Code Here

   *
   * @param instanceEntity  the instance entity
   * @param key             the data key
   */
  public void removeInstanceData(ViewInstanceEntity instanceEntity, String key) {
    ViewInstanceDataEntity dataEntity = instanceEntity.getInstanceData(key);
    if (dataEntity != null) {
      instanceDAO.removeData(dataEntity);
    }
    instanceEntity.removeInstanceData(key);
    instanceDAO.merge(instanceEntity);
View Full Code Here

        viewInstancePropertyEntity.setValue((String) entry.getValue());
        viewInstancePropertyEntity.setViewInstanceEntity(viewInstanceEntity);

        instanceProperties.add(viewInstancePropertyEntity);
      } else if (propertyName.startsWith(DATA_PREFIX)) {
        ViewInstanceDataEntity viewInstanceDataEntity = new ViewInstanceDataEntity();

        viewInstanceDataEntity.setViewName(viewName);
        viewInstanceDataEntity.setViewInstanceName(name);
        viewInstanceDataEntity.setName(entry.getKey().substring(DATA_PREFIX.length()));
        viewInstanceDataEntity.setValue((String) entry.getValue());
        viewInstanceDataEntity.setViewInstanceEntity(viewInstanceEntity);

        instanceData.add(viewInstanceDataEntity);
      }
    }
    viewInstanceEntity.setProperties(instanceProperties);
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.orm.entities.ViewInstanceDataEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.