@Test
  public void testFindHostsByStage() {
    ormTestHelper.createStageCommands();
    StageEntity stageEntity = stageDAO.findByActionId("1-1");
    log.info("StageEntity {} {}" + stageEntity.getRequestId() + " "
        + stageEntity.getStageId());
    List<HostEntity> hosts = hostDAO.findByStage(stageEntity);
    assertEquals(2, hosts.size());
  }
to clarify: are cascade operations allowed?
ambari-server/src/test/java/org/apache/ambari/server/orm/TestOrmImpl.java