@Override
      public void run() {
        ResourceEntity resourceEntity = new ResourceEntity();
        resourceEntity.setResourceType(finalResourceTypeEntity);
        ClusterEntity temp = new ClusterEntity();
        temp.setClusterName("temp_cluster");
        temp.setResource(resourceEntity);
        temp.setDesiredStack(stackEntity);
        clusterDAO.create(temp);
      }
to clarify: are cascade operations allowed?
ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java