@Test public void testFindForCluster() throws Exception { List<UpgradeEntity> items = dao.findUpgrades(clusterId.longValue()); assertEquals(1, items.size()); }
@RequiresSession public List<UpgradeEntity> findUpgrades(long clusterId) { TypedQuery<UpgradeEntity> query = entityManagerProvider.get().createNamedQuery( "UpgradeEntity.findAllForCluster", UpgradeEntity.class); query.setParameter("clusterId", Long.valueOf(clusterId)); return daoUtils.selectList(query); }
UpgradeDAO { @RequiresSession public List<UpgradeEntity> findUpgrades(long clusterId) { TypedQuery<UpgradeEntity> query = entityManagerProvider.get().createNamedQuery( "UpgradeEntity.findAllForCluster", UpgradeEntity.class); query.setParameter("clusterId", Long.valueOf(clusterId)); return daoUtils.selectList(query); } }
UpgradeDAO { @RequiresSession public List<UpgradeEntity> findUpgrades(long clusterId) { TypedQuery<UpgradeEntity> query = entityManagerProvider.get().createNamedQuery( "UpgradeEntity.findAllForCluster", UpgradeEntity.class); query.setParameter("clusterId", Long.valueOf(clusterId)); return daoUtils.selectList(query); }  }
UpgradeDAO { @RequiresSession public List<UpgradeEntity> findUpgrades(long clusterId) { TypedQuery<UpgradeEntity> query = entityManagerProvider.get().createNamedQuery( "UpgradeEntity.findAllForCluster", UpgradeEntity.class); query.setParameter("clusterId", Long.valueOf(clusterId)); return daoUtils.selectList(query); }  @RequiresSession List<UpgradeEntity> findAll(); @RequiresSession List<UpgradeEntity> findUpgrades(long clusterId); @RequiresSession UpgradeEntity findUpgrade(long upgradeId); @RequiresSession UpgradeEntity findUpgradeByRequestId(Long requestId); @Transactional void create(UpgradeEntity entity); @Transactional void removeAll(long clusterId); @RequiresSession UpgradeGroupEntity findUpgradeGroup(Long groupId); @RequiresSession UpgradeItemEntity findUpgradeItem(long itemId); @RequiresSession UpgradeItemEntity findUpgradeItemByRequestAndStage(Long requestId, Long stageId); @RequiresSession UpgradeEntity findLastUpgradeForCluster(long clusterId, Direction direction); @RequiresSession UpgradeEntity findLastUpgradeOrDowngradeForCluster(long clusterId); @Transactional UpgradeEntity merge(UpgradeEntity upgradeEntity); }
UpgradeDAO { @RequiresSession public List<UpgradeEntity> findUpgrades(long clusterId) { TypedQuery<UpgradeEntity> query = entityManagerProvider.get().createNamedQuery( "UpgradeEntity.findAllForCluster", UpgradeEntity.class); query.setParameter("clusterId", Long.valueOf(clusterId)); return daoUtils.selectList(query); }  @RequiresSession List<UpgradeEntity> findAll(); @RequiresSession List<UpgradeEntity> findUpgrades(long clusterId); @RequiresSession UpgradeEntity findUpgrade(long upgradeId); @RequiresSession UpgradeEntity findUpgradeByRequestId(Long requestId); @Transactional void create(UpgradeEntity entity); @Transactional void removeAll(long clusterId); @RequiresSession UpgradeGroupEntity findUpgradeGroup(Long groupId); @RequiresSession UpgradeItemEntity findUpgradeItem(long itemId); @RequiresSession UpgradeItemEntity findUpgradeItemByRequestAndStage(Long requestId, Long stageId); @RequiresSession UpgradeEntity findLastUpgradeForCluster(long clusterId, Direction direction); @RequiresSession UpgradeEntity findLastUpgradeOrDowngradeForCluster(long clusterId); @Transactional UpgradeEntity merge(UpgradeEntity upgradeEntity);  }