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


Java TxType.SUPPORTS属性代码示例

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


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

示例1: read

@Override
@Transactional(value = TxType.SUPPORTS)
public E read(final E transientInstance) throws MessageLabelException {
    log.trace("Read entity {}", transientInstance);
    if (transientInstance == null || transientInstance.getPrimaryKey() == null) {
        throw new NullPrimaryKeyException();
    }
    return findByPk(transientInstance.getPrimaryKey());
}
 
开发者ID:qjafcunuas,项目名称:jbromo,代码行数:9,代码来源:AbstractEntityDao.java

示例2: findByPk

@Override
@Transactional(TxType.SUPPORTS)
public E findByPk(final P pk) throws MessageLabelException {
    log.trace("Get entity {} for pk {}", getModelClass().getName(), pk);
    if (pk == null) {
        throw new NullPrimaryKeyException();
    }
    final E entity = getEntityManager().find(getModelClass(), pk);
    if (entity == null) {
        log.trace("Object {} is not found for pk {}", getModelClass().getName(), pk);
    } else {
        log.trace("Object {} is found for pk {}", getModelClass().getName(), pk);
    }
    return entity;
}
 
开发者ID:qjafcunuas,项目名称:jbromo,代码行数:15,代码来源:AbstractEntityDao.java

示例3: findAllByPk

@Override
@SuppressWarnings("unchecked")
@Transactional(TxType.SUPPORTS)
public Collection<E> findAllByPk(final Collection<P> primaryKeys, final E eagerLoading) throws MessageLabelException {
    if (primaryKeys == null) {
        return null;
    }
    E eager = eagerLoading;
    if (eagerLoading == null) {
        eager = ObjectUtil.newInstance(getModelClass());
    }
    if (CollectionUtil.isEmpty(primaryKeys)) {
        return ObjectUtil.newInstance(primaryKeys.getClass());
    }
    if (primaryKeys.size() >= MAX_ELEMENTS) {
        throw new TooMuchDataException(MAX_ELEMENTS);
    }

    log.trace("Get entities {} for {} pk with eager loading ", getModelClass().getName(), primaryKeys.size());
    final JpqlEntityQueryBuilder<E> queryBuilder = getQueryBuilder(eager);
    queryBuilder.getWhere().in(queryBuilder.getAlias(eager) + StringUtil.DOT + EntityUtil.getPrimaryKeyField(getModelClass()).getName(),
                               primaryKeys);
    final List<E> entities = queryBuilder.getResultList();
    log.trace("Found {} entities {}", entities.size(), getModelClass().getName());
    if (primaryKeys.getClass().equals(entities.getClass())) {
        return entities;
    } else {
        return CollectionUtil.toCollection(entities, primaryKeys.getClass());
    }
}
 
开发者ID:qjafcunuas,项目名称:jbromo,代码行数:30,代码来源:AbstractEntityDao.java

示例4: findAll

@Override
@Transactional(TxType.SUPPORTS)
public List<E> findAll() throws MessageLabelException {
    log.trace("Find all entities {}", getModelClass().getName());
    final JpqlEntityQueryBuilder<E> queryBuilder = getQueryBuilder(null);
    final List<E> entities = queryBuilder.getResultList();
    log.trace("Found {} elements for entities {}", entities.size(), getModelClass().getName());
    return entities;
}
 
开发者ID:qjafcunuas,项目名称:jbromo,代码行数:9,代码来源:AbstractEntityDao.java

示例5: getKey

@Override
@Transactional(value = TxType.SUPPORTS)
public String getKey() {
	return SERVICE_KEY;
}
 
开发者ID:ligoj,项目名称:plugin-id-ldap,代码行数:5,代码来源:BugTrackerResource.java

示例6: getTask

@Transactional(TxType.SUPPORTS)
@Override
public Task getTask(Integer id) {
    return em.find(Task.class, id);
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:5,代码来源:TaskServiceImpl.java

示例7: getTasks

@Transactional(TxType.SUPPORTS)
@Override
public Collection<Task> getTasks() {
    CriteriaQuery<Task> query = em.getCriteriaBuilder().createQuery(Task.class);
    return em.createQuery(query.select(query.from(Task.class))).getResultList();
}
 
开发者ID:apache,项目名称:aries-jpa,代码行数:6,代码来源:TaskServiceImpl.java

示例8: getKey

@Override
@Transactional(value = TxType.SUPPORTS)
public String getKey() {
	return JiraBaseResource.KEY;
}
 
开发者ID:ligoj,项目名称:plugin-bt-jira,代码行数:5,代码来源:JiraPluginResource.java

示例9: getLastVersion

@Override
@Transactional(value = TxType.SUPPORTS)
public String getLastVersion() throws Exception {
	// Get the download json from the default repository
	return versionUtils.getLatestReleasedVersionName("https://jira.atlassian.com", "JRA");
}
 
开发者ID:ligoj,项目名称:plugin-bt-jira,代码行数:6,代码来源:JiraPluginResource.java

示例10: expandValueSet

@Override
@Transactional(value = TxType.SUPPORTS)
public ValueSetExpansionComponent expandValueSet(FhirContext theCtx, ConceptSetComponent theInclude) {
	return null;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:5,代码来源:JpaValidationSupportDstu3.java

示例11: fetchAllStructureDefinitions

@Override
@Transactional(value = TxType.SUPPORTS)
public List<StructureDefinition> fetchAllStructureDefinitions(FhirContext theContext) {
	return Collections.emptyList();
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:5,代码来源:JpaValidationSupportDstu3.java

示例12: isCodeSystemSupported

@Override
@Transactional(value = TxType.SUPPORTS)
public boolean isCodeSystemSupported(FhirContext theCtx, String theSystem) {
	return false;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:5,代码来源:JpaValidationSupportDstu3.java

示例13: validateCode

@Override
@Transactional(value = TxType.SUPPORTS)
public CodeValidationResult validateCode(FhirContext theCtx, String theCodeSystem, String theCode, String theDisplay) {
	return null;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:5,代码来源:JpaValidationSupportDstu3.java

示例14: fetchCodeSystem

@Override
@Transactional(value = TxType.SUPPORTS)
public ValueSet fetchCodeSystem(FhirContext theCtx, String theSystem) {
	return null;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:5,代码来源:JpaValidationSupportDstu2.java

示例15: getVersion

/**
 * Return the version of JIRA from the database.
 * 
 * @param parameters
 *            The parameters required to connect to the JIRA database.
 * @return The version of JIRA from the database.
 */
@Transactional(value = TxType.SUPPORTS)
@org.springframework.transaction.annotation.Transactional(readOnly = true)
public String getVersion(final Map<String, String> parameters) {
	// Get previously resolved version if available or query it from SQL
	return parameters.computeIfAbsent(PARAMETER_CACHE_VERSION, v -> jiraDao.getJiraVersion(getDataSource(parameters)));
}
 
开发者ID:ligoj,项目名称:plugin-bt-jira,代码行数:13,代码来源:JiraBaseResource.java


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