当前位置: 首页>>代码示例>>Java>>正文


Java TransactionAttributeType.MANDATORY属性代码示例

本文整理汇总了Java中javax.ejb.TransactionAttributeType.MANDATORY属性的典型用法代码示例。如果您正苦于以下问题:Java TransactionAttributeType.MANDATORY属性的具体用法?Java TransactionAttributeType.MANDATORY怎么用?Java TransactionAttributeType.MANDATORY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.ejb.TransactionAttributeType的用法示例。


在下文中一共展示了TransactionAttributeType.MANDATORY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOrganizations

@TransactionAttribute(TransactionAttributeType.MANDATORY)
public List<POPartner> getOrganizations(OrganizationRoleType orgRole,
                                        long serviceKey) {
    final List<Object[]> organizations = getOrganizationsFromDB(orgRole,
            serviceKey);
    final List<POPartner> result = new ArrayList<>();
    for (Object[] o : organizations) {
        PORevenueShare r = null;
        if (o[3] != null) {
            r = new PORevenueShare();
            r.setRevenueShare(new BigDecimal("" + o[3]));
        }
        result.add(new POPartner(((Number) o[0]).longValue(),
                (String) o[1], (String) o[2], r, o[4] != null));
    }
    return result;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:OrganizationDao.java

示例2: getLastValidGroupHistory

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public UserGroupHistory getLastValidGroupHistory(long groupKey,
        long endOfBillingPeriod) {
    Query query = dm
            .createNamedQuery("UserGroupHistory.findLastValidForEndPeriod");
    query.setParameter("objKey", Long.valueOf(groupKey));
    query.setParameter("endDate", new Date(endOfBillingPeriod));
    query.setMaxResults(1);
    List<?> qryresult = query.getResultList();
    if (qryresult.size() == 0) {
        return null;
    } else {
        return (UserGroupHistory) qryresult.get(0);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:16,代码来源:BillingDataRetrievalServiceBean.java

示例3: getSuppliersForTechnicalService

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public List<Organization> getSuppliersForTechnicalService(
        long technicalServiceKey) throws ObjectNotFoundException,
        OperationNotPermittedException {

    TechnicalProduct tpRef = ds.getReference(TechnicalProduct.class,
            technicalServiceKey);
    PermissionCheck.owns(tpRef, ds.getCurrentUser().getOrganization(),
            logger, null);
    Query query = ds
            .createNamedQuery("MarketingPermission.getOrgsForUsingTechnicalService");
    query.setParameter("tpKey", Long.valueOf(technicalServiceKey));
    query.setParameter("refType",
            OrganizationReferenceType.TECHNOLOGY_PROVIDER_TO_SUPPLIER);
    List<Organization> result = ParameterizedTypes.list(
            query.getResultList(), Organization.class);

    return result;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:20,代码来源:MarketingPermissionServiceBean.java

示例4: addUserToSubscription

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public UsageLicense addUserToSubscription(Subscription subscription,
        PlatformUser user, RoleDefinition serviceRole)
        throws UserAlreadyAssignedException {

    final UsageLicense usageLicense = subscription.addUser(user,
            serviceRole);

    audit.assignUserToSubscription(dataManager, subscription, usageLicense);
    return usageLicense;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:12,代码来源:SubscriptionServiceBean.java

示例5: getPartnerProductsForTemplate

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
@SuppressWarnings("unchecked")
public List<Product> getPartnerProductsForTemplate(long serviceKey)
        throws ObjectNotFoundException, ServiceOperationException {

    Product product = dm.getReference(Product.class, serviceKey);
    validateProductTemplate(product);

    Query query = dm
            .createNamedQuery("Product.getPartnerCopiesForTemplate");
    query.setParameter("template", product);
    return query.getResultList();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:14,代码来源:ServiceProvisioningPartnerServiceLocalBean.java

示例6: setAPPSuspend

@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void setAPPSuspend(String isSupsend) {
    LOGGER.debug("Storing suspend setting for APP");
    HashMap<String, Setting> setting = new HashMap<>();
    setting.put(APP_SUSPEND, new Setting(APP_SUSPEND, isSupsend));
    try {
        storeControllerConfigurationSettings(PROXY_ID, setting);
    } catch (ConfigurationException exception) {
        // this exception should not happen due to no encryption needed for
        // APP_SUSPEND, no handle needed
    }
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:12,代码来源:APPConfigurationServiceBean.java

示例7: removeMarketplaceAccess

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void removeMarketplaceAccess(long marketplaceKey,
        long organizationKey) throws ObjectNotFoundException {
    MarketplaceAccess marketplaceAccess = new MarketplaceAccess();
    marketplaceAccess.setMarketplace_tkey(marketplaceKey);
    marketplaceAccess.setOrganization_tkey(organizationKey);

    try {
        MarketplaceAccess mpa = (MarketplaceAccess) ds
                .getReferenceByBusinessKey(marketplaceAccess);
        ds.remove(mpa);
    } catch (ObjectNotFoundException e) {
        // if no entry exists just continue
    }

    Organization org = ds.getReference(Organization.class, organizationKey);
    Marketplace mp = ds.getReference(Marketplace.class, marketplaceKey);

    CatalogEntry ce;
    for (Product prod : org.getProducts()) {
        ce = prod.getCatalogEntryForMarketplace(mp);
        if (ce != null) {
            ce.setMarketplace(null);
        }
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:27,代码来源:MarketplaceServiceLocalBean.java

示例8: get

/**
 * Loads the localized billing resource using its database or business key.
 * 
 * @param localizedBillingResource
 *            localized billing resource with key or business key set
 * @return localized billing resource
 */
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public LocalizedBillingResource get(
        org.oscm.domobjects.LocalizedBillingResource localizedBillingResource) {
    if (localizedBillingResource == null) {
        return null;
    }
    if (localizedBillingResource.getKey() != 0L) {
        return dm.find(LocalizedBillingResource.class,
                localizedBillingResource.getKey());
    }
    return (LocalizedBillingResource) dm.find(localizedBillingResource);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:LocalizedBillingResourceDAO.java

示例9: loadSteppedPricesForPriceModel

/**
 * @see BillingDataRetrievalServiceLocal#loadSteppedPricesForPriceModel(long,
 *      long)
 */
@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public List<SteppedPriceData> loadSteppedPricesForPriceModel(
        long priceModelKey, long periodEndTime) {
    List<SteppedPriceHistory> steppedPrices = findSteppedPricesForPriceModel(
            priceModelKey, periodEndTime);

    List<SteppedPriceData> result = new ArrayList<SteppedPriceData>();
    for (SteppedPriceHistory steppedPrice : steppedPrices) {
        result.add(new SteppedPriceData(steppedPrice));
    }
    return result;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:BillingDataRetrievalServiceBean.java

示例10: remove

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void remove(DomainObject<?> obj) {
    setThreadLocals();
    if (em.contains(obj)) {
        em.remove(obj);
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:8,代码来源:DataServiceBean.java

示例11: reinvokePaymentProcessing

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public boolean reinvokePaymentProcessing() {
    List<PaymentResult> forRetry = getPaymentResultsForRetry();
    boolean result = true;
    for (PaymentResult retryPR : forRetry) {
        result = result && chargeCustomer(retryPR.getBillingResult());
    }
    return result;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:10,代码来源:PaymentServiceBean.java

示例12: getCustomers

@TransactionAttribute(TransactionAttributeType.MANDATORY)
public List<Organization> getCustomers(Organization seller) {

    OrganizationReferenceType referenceType = getCustomerReferenceType(
            seller);
    Query query = dm.createNamedQuery("Organization.getForSupplierKey");
    query.setParameter("supplierKey", Long.valueOf(seller.getKey()));
    query.setParameter("referenceType", referenceType);
    List<Organization> list = ParameterizedTypes.list(query.getResultList(),
            Organization.class);

    return list;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:13,代码来源:AccountServiceBean.java

示例13: deleteTriggerDefinitionInt

@RolesAllowed({ "ORGANIZATION_ADMIN", "PLATFORM_OPERATOR" })
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void deleteTriggerDefinitionInt(long triggerDefinitionKey)
        throws ObjectNotFoundException, DeletionConstraintException,
        OperationNotPermittedException {

    TriggerDefinition triggerDefinition = dm.getReference(
            TriggerDefinition.class, triggerDefinitionKey);

    checkOrgAuthority(triggerDefinition);

    // check if there are trigger processes exist for current trigger
    // definition.
    // excepts the triggerDefinition can not be deleted
    Query query = dm
            .createNamedQuery("TriggerProcess.getAllForTriggerDefinition");
    query.setParameter("triggerDefinitionKey",
            Long.valueOf(triggerDefinitionKey));
    List<TriggerProcess> triggerProcessList = ParameterizedTypes.list(
            query.getResultList(), TriggerProcess.class);
    if (triggerProcessList.size() > 0) {
        DeletionConstraintException sdce = new DeletionConstraintException(
                ClassEnum.TRIGGER_DEFINITION,
                String.valueOf(triggerDefinitionKey),
                ClassEnum.TRIGGER_PROCESS);
        logger.logWarn(Log4jLogger.SYSTEM_LOG, sdce,
                LogMessageIdentifier.WARN_TRIGGER_DELETION_FAILED);
        throw sdce;
    }
    dm.remove(triggerDefinition);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:32,代码来源:TriggerDefinitionServiceBean.java

示例14: removeUserRoles

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void removeUserRoles(String organizationId)
        throws ObjectNotFoundException {
    Organization organization = new Organization();
    organization.setOrganizationId(organizationId);
    Organization org = (Organization) ds
            .getReferenceByBusinessKey(organization);
    for (PlatformUser pUser : org.getPlatformUsers()) {
        Set<RoleAssignment> roles = pUser.getAssignedRoles();
        if (roles != null && roles.size() > 0) {
            RoleAssignment roleToRemove = null;
            for (RoleAssignment userRole : roles) {
                if (userRole.getRole().getRoleName()
                        .equals(UserRoleType.MARKETPLACE_OWNER)) {
                    roleToRemove = userRole;
                    break;
                }
            }
            if (roleToRemove != null) {
                pUser.getAssignedRoles().remove(roleToRemove);
                ds.remove(roleToRemove);
            }
        }

    }
    ds.flush();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:28,代码来源:MarketplaceServiceLocalBean.java

示例15: getOrganizationForDiscountEndNotificiation

@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public List<OrganizationReference> getOrganizationForDiscountEndNotificiation(
        long currentTimeMillis) {

    return null;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:7,代码来源:AccountServiceStub.java


注:本文中的javax.ejb.TransactionAttributeType.MANDATORY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。