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


Java CustomAttribute类代码示例

本文整理汇总了Java中org.oscm.app.domain.CustomAttribute的典型用法代码示例。如果您正苦于以下问题:Java CustomAttribute类的具体用法?Java CustomAttribute怎么用?Java CustomAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createCustomAttribute

import org.oscm.app.domain.CustomAttribute; //导入依赖的package包/类
/**
 * Creates and persists a custom attribute.
 * 
 * @param key
 * @param value
 * @throws Exception
 */
private void createCustomAttribute(final String key, final String value,
        final boolean encrypted, final String organizationId)
        throws Exception {
    runTX(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            String val = value == null ? "testValue" : value;
            CustomAttribute ca = new CustomAttribute();
            ca.setAttributeKey(key);
            ca.setOrganizationId(organizationId);
            ca.setEncrypted(encrypted);
            ca.setAttributeValue(val);
            em.persist(ca);
            return null;
        }
    });
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:25,代码来源:PasswordSetupIT.java

示例2: createCustomAttribute

import org.oscm.app.domain.CustomAttribute; //导入依赖的package包/类
/**
 * Creates and persists a custom attribute.
 * 
 * @param key
 * @param value
 * @throws Exception
 */
private void createCustomAttribute(final String key, final String value,
        final String organizationId) throws Exception {
    runTX(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
            String val = value == null ? "testValue" : value;
            CustomAttribute cs = new CustomAttribute();
            cs.setAttributeKey(key);
            cs.setOrganizationId(organizationId);
            cs.setAttributeValue(val);
            em.persist(cs);
            return null;
        }
    });
}
 
开发者ID:servicecatalog,项目名称:oscm-app,代码行数:23,代码来源:APPConfigurationServiceIT.java

示例3: getCustomAttributes

import org.oscm.app.domain.CustomAttribute; //导入依赖的package包/类
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public HashMap<String, Setting> getCustomAttributes(String organizationId)
        throws ConfigurationException {

    LOGGER.debug("Retrieving custom settings for organization '{}'",
            organizationId);

    HashMap<String, Setting> result = new HashMap<>();

    if (organizationId != null) {
        TypedQuery<CustomAttribute> query = em.createNamedQuery(
                "CustomAttribute.getForOrg", CustomAttribute.class);
        query.setParameter("oid", organizationId);
        List<CustomAttribute> resultList = query.getResultList();
        try {
            for (CustomAttribute entry : resultList) {
                result.put(entry.getAttributeKey(), new Setting(
                        entry.getAttributeKey(), entry.getDecryptedValue(),
                        entry.isEncrypted(), entry.getControllerId()));
            }
        } catch (BadResultException e) {
            throw new ConfigurationException(e.getMessage());
        }
    }

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


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