本文整理汇总了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());
}
示例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;
}
示例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());
}
}
示例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;
}
示例5: getKey
@Override
@Transactional(value = TxType.SUPPORTS)
public String getKey() {
return SERVICE_KEY;
}
示例6: getTask
@Transactional(TxType.SUPPORTS)
@Override
public Task getTask(Integer id) {
return em.find(Task.class, id);
}
示例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();
}
示例8: getKey
@Override
@Transactional(value = TxType.SUPPORTS)
public String getKey() {
return JiraBaseResource.KEY;
}
示例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");
}
示例10: expandValueSet
@Override
@Transactional(value = TxType.SUPPORTS)
public ValueSetExpansionComponent expandValueSet(FhirContext theCtx, ConceptSetComponent theInclude) {
return null;
}
示例11: fetchAllStructureDefinitions
@Override
@Transactional(value = TxType.SUPPORTS)
public List<StructureDefinition> fetchAllStructureDefinitions(FhirContext theContext) {
return Collections.emptyList();
}
示例12: isCodeSystemSupported
@Override
@Transactional(value = TxType.SUPPORTS)
public boolean isCodeSystemSupported(FhirContext theCtx, String theSystem) {
return false;
}
示例13: validateCode
@Override
@Transactional(value = TxType.SUPPORTS)
public CodeValidationResult validateCode(FhirContext theCtx, String theCodeSystem, String theCode, String theDisplay) {
return null;
}
示例14: fetchCodeSystem
@Override
@Transactional(value = TxType.SUPPORTS)
public ValueSet fetchCodeSystem(FhirContext theCtx, String theSystem) {
return null;
}
示例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)));
}