@Test public void testFindByStack() { createSingleRecord(); Assert.assertEquals(0, repositoryVersionDAO.findByStack(BAD_STACK).size()); Assert.assertEquals(1, repositoryVersionDAO.findByStack(HDP_206).size()); }
@RequiresSession public List<RepositoryVersionEntity> findByStack(StackId stackId) { final TypedQuery<RepositoryVersionEntity> query = entityManagerProvider.get().createNamedQuery("repositoryVersionByStack", RepositoryVersionEntity.class); query.setParameter("stackName", stackId.getStackName()); query.setParameter("stackVersion", stackId.getStackVersion()); return daoUtils.selectList(query); }
RepositoryVersionDAO extends CrudDAO<RepositoryVersionEntity, Long> { @RequiresSession public List<RepositoryVersionEntity> findByStack(StackId stackId) { final TypedQuery<RepositoryVersionEntity> query = entityManagerProvider.get().createNamedQuery("repositoryVersionByStack", RepositoryVersionEntity.class); query.setParameter("stackName", stackId.getStackName()); query.setParameter("stackVersion", stackId.getStackVersion()); return daoUtils.selectList(query); } }
RepositoryVersionDAO extends CrudDAO<RepositoryVersionEntity, Long> { @RequiresSession public List<RepositoryVersionEntity> findByStack(StackId stackId) { final TypedQuery<RepositoryVersionEntity> query = entityManagerProvider.get().createNamedQuery("repositoryVersionByStack", RepositoryVersionEntity.class); query.setParameter("stackName", stackId.getStackName()); query.setParameter("stackVersion", stackId.getStackVersion()); return daoUtils.selectList(query); } RepositoryVersionDAO(); }
RepositoryVersionDAO extends CrudDAO<RepositoryVersionEntity, Long> { @RequiresSession public List<RepositoryVersionEntity> findByStack(StackId stackId) { final TypedQuery<RepositoryVersionEntity> query = entityManagerProvider.get().createNamedQuery("repositoryVersionByStack", RepositoryVersionEntity.class); query.setParameter("stackName", stackId.getStackName()); query.setParameter("stackVersion", stackId.getStackVersion()); return daoUtils.selectList(query); } RepositoryVersionDAO(); @Override @Transactional void create(RepositoryVersionEntity entity); @RequiresSession RepositoryVersionEntity findByDisplayName(String displayName); @RequiresSession RepositoryVersionEntity findByStackAndVersion(StackId stackId,
      String version); @RequiresSession RepositoryVersionEntity findByStackAndVersion(StackEntity stackEntity,
      String version); @RequiresSession RepositoryVersionEntity findByStackNameAndVersion(String stackName, String version); @RequiresSession List<RepositoryVersionEntity> findByStack(StackId stackId); RepositoryVersionEntity create(StackEntity stackEntity,
      String version, String displayName,
      String operatingSystems); @Transactional RepositoryVersionEntity create(StackEntity stackEntity,
      String version, String displayName,
      String operatingSystems, RepositoryType type); @RequiresSession List<RepositoryVersionEntity> findAllDefinitions(); }
RepositoryVersionDAO extends CrudDAO<RepositoryVersionEntity, Long> { @RequiresSession public List<RepositoryVersionEntity> findByStack(StackId stackId) { final TypedQuery<RepositoryVersionEntity> query = entityManagerProvider.get().createNamedQuery("repositoryVersionByStack", RepositoryVersionEntity.class); query.setParameter("stackName", stackId.getStackName()); query.setParameter("stackVersion", stackId.getStackVersion()); return daoUtils.selectList(query); } RepositoryVersionDAO(); @Override @Transactional void create(RepositoryVersionEntity entity); @RequiresSession RepositoryVersionEntity findByDisplayName(String displayName); @RequiresSession RepositoryVersionEntity findByStackAndVersion(StackId stackId,
      String version); @RequiresSession RepositoryVersionEntity findByStackAndVersion(StackEntity stackEntity,
      String version); @RequiresSession RepositoryVersionEntity findByStackNameAndVersion(String stackName, String version); @RequiresSession List<RepositoryVersionEntity> findByStack(StackId stackId); RepositoryVersionEntity create(StackEntity stackEntity,
      String version, String displayName,
      String operatingSystems); @Transactional RepositoryVersionEntity create(StackEntity stackEntity,
      String version, String displayName,
      String operatingSystems, RepositoryType type); @RequiresSession List<RepositoryVersionEntity> findAllDefinitions();  }