@Override
    public List<OrganizationSummaryBean> getOrgs(Set<String> orgIds) throws StorageException {
        List<OrganizationSummaryBean> orgs = new ArrayList<>();
        if (orgIds == null || orgIds.isEmpty()) {
            return orgs;
        }
        beginTx();
        try {
            EntityManager entityManager = getActiveEntityManager();
            String jpql = "SELECT o from OrganizationBean o WHERE o.id IN :orgs ORDER BY o.id ASC";
            Query query = entityManager.createQuery(jpql);
            query.setParameter("orgs", orgIds);
            List<OrganizationBean> qr = query.getResultList();
            for (OrganizationBean bean : qr) {
                OrganizationSummaryBean summary = new OrganizationSummaryBean();
                summary.setId(bean.getId());
                summary.setName(bean.getName());
                summary.setDescription(bean.getDescription());
                orgs.add(summary);
            }
            return orgs;
        } catch (Throwable t) {
            logger.error(t.getMessage(), t);
            throw new StorageException(t);
        } finally {
            rollbackTx();
        }
    }
@ Override public List < OrganizationSummaryBean > getOrgs ( Set < String > orgIds ) throws StorageException { List < OrganizationSummaryBean > orgs = new ArrayList < > ( ) ; if ( orgIds == null || orgIds . isEmpty ( ) ) { return orgs ; } beginTx ( ) ; try { EntityManager entityManager = getActiveEntityManager ( ) ; String jpql = "SELECT o from OrganizationBean o WHERE o.id IN :orgs ORDER BY o.id ASC" ; Query query = entityManager . createQuery ( jpql ) ; query . setParameter ( "orgs" , orgIds ) ; List < OrganizationBean > qr = query . getResultList ( ) ; for ( OrganizationBean bean : qr ) { OrganizationSummaryBean summary = new OrganizationSummaryBean ( ) ; summary . setId ( bean . getId ( ) ) ; summary . setName ( bean . getName ( ) ) ; summary . setDescription ( bean . getDescription ( ) ) ; orgs . add ( summary ) ; } return orgs ; } catch ( Throwable t ) { logger . error ( t . getMessage ( ) , t ) ; throw new StorageException ( t ) ; } finally { rollbackTx ( ) ; } }
@see io.apiman.manager.api.core.IStorageQuery#getOrgs(java.util.Set)