ServiceInstanceDAO.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:oscm 作者:
public ServiceInstance getInstanceBySubscriptionAndOrganization(
        String subscriptionId, String organizationId)
        throws ServiceInstanceNotFoundException {
    if (Strings.isEmpty(subscriptionId) || Strings.isEmpty(organizationId)) {
        throw new ServiceInstanceNotFoundException(
                "Subscription or organization ID not set or empty.");
    }
    Query query = em
            .createNamedQuery("ServiceInstance.getForSubscriptionAndOrg");
    query.setParameter("subscriptionId", subscriptionId);
    query.setParameter("organizationId", organizationId);
    try {
        final ServiceInstance instance = (ServiceInstance) query
                .getSingleResult();
        return instance;
    } catch (NoResultException e) {
        throw new ServiceInstanceNotFoundException(
                "Service instance for subscription '%s' and organization '%s' not found.",
                subscriptionId, organizationId);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号