热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

com.mysema.query.types.path.NumberPath类的使用及代码示例

本文整理了Java中com.mysema.query.types.path.NumberPath类的一些代码示例,展示了NumberPath类

本文整理了Java中com.mysema.query.types.path.NumberPath类的一些代码示例,展示了NumberPath类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NumberPath类的具体详情如下:
包路径:com.mysema.query.types.path.NumberPath
类名称:NumberPath

NumberPath介绍

[英]NumberPath represents numeric paths
[中]NumberPath表示数字路径

代码示例

代码示例来源:origin: spring-projects/spring-data-book

@Override
@Transactional(readOnly= true)
public Customer findById(Long id) {
if (id == null) {
return null;
}
return findOne(qCustomer.id.eq(id));
}

代码示例来源:origin: spring-projects/spring-data-book

@Override
public long doInSqlDeleteClause(SQLDeleteClause delete) {
return delete.where(qAddress.customerId.eq(customer.getId()).and(qAddress.id.notIn(ids))).execute();
}
});

代码示例来源:origin: org.gvnix/org.gvnix.web.datatables

return numberExpression.eq((N) valueConverted);
return numberExpression.gt((N) valueConverted);
return numberExpression.lt((N) valueConverted);
return numberExpression.goe((N) valueConverted);
return numberExpression.loe((N) valueConverted);
return numberExpression.ne((N) valueConverted);
return numberExpression.between((N) valueFromConverted,
(N) valueToConverted);
Matcher isNullMatcher = isNullOperator.matcher(searchStr);
if (isNullMatcher.matches()) {
return numberExpression.isNull();
Matcher isNotNullMatcher = isNotNullOperator.matcher(searchStr);
if (isNotNullMatcher.matches()) {
return numberExpression.isNotNull();

代码示例来源:origin: es.uji.commons/uji-commons-sso

public List getItemsAccesiblesByPersona(String codigoAplicacion,
Long personaId)
{
JPAQuery query = new JPAQuery(entityManager);
QApaVwPersonasItems apaVWPersOnasItems= QApaVwPersonasItems.apaVwPersonasItems;
query.from(apaVWPersonasItems)
.where(apaVWPersonasItems.personaId.eq(new BigDecimal(personaId)).and(
apaVWPersonasItems.aplicacionCodigo.eq(codigoAplicacion)))
.orderBy(apaVWPersonasItems.orden.asc());
return query.list(apaVWPersonasItems);
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public Set getWorklogsForIds(final Set worklogIds, final int maxResults)
{
return dbConnectionManager.executeQuery(dbConnection -> dbConnection.newSqlQuery()
.from(WORKLOG)
.leftJoin(QProjectRole.PROJECT_ROLE)
.on(QProjectRole.PROJECT_ROLE.id.eq(WORKLOG.rolelevel))
.where(WORKLOG.id.in(worklogIds))
.limit(maxResults)
.list(WORKLOG_ALIASED_PROJECT_ROLE_TUPLE)
).stream()
.map(queryDSLWorklogFactory::createWorklogWithAliasedIdColumn)
.collect(Collectors.toSet());
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
public void Case2() {
assertEquals(ImmutableList.of(4, 4, 4, 4, 4, 4),
query().from(cat)
.list(Expressions.cases().when(cat.toes.eq(2)).then(cat.id.multiply(2))
.when(cat.toes.eq(3)).then(cat.id.multiply(3))
.otherwise(4)));
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
@ExcludeIn(MYSQL) // doesn't work in Eclipselink
public void Case4() {
NumberExpression numExpression = cat.bodyWeight.floatValue().divide(otherCat.bodyWeight.floatValue()).multiply(100);
NumberExpression numExpression2 = cat.id.when(0).then(0.0F).otherwise(numExpression);
assertEquals(ImmutableList.of(200, 150, 133, 125, 120),
query().from(cat, otherCat)
.where(cat.id.eq(otherCat.id.add(1)))
.orderBy(cat.id.asc(), otherCat.id.asc())
.list(numExpression2.intValue()));
}

代码示例来源:origin: com.atlassian.jira/jira-core

public ConstantsCache get()
{
final List priorityList = dbConnectionManager.executeQuery(dbConnection -> dbConnection.newSqlQuery().from(PRIORITY)
.orderBy(PRIORITY.sequence.asc()).list(PRIORITY));
final ImmutableMap.Builder builder = ImmutableMap.builder();
priorityList.stream().map(issueConstantFactory::createPriority).forEach(p -> builder.put(p.getId(), p));
return new ConstantsCache<>(builder.build());
}
}

代码示例来源:origin: com.atlassian.jira/jira-core

.from(a)
.where(a.avatarType.eq(ISSUE_TYPE_AVATAR)
.and(a.systemAvatar.eq(TRUE))
.and(a.fileName.in(issueTypeIconsToReplace.keySet())))
.groupBy(a.fileName)
.map(a.fileName, a.id.min());
.and(a.systemAvatar.eq(TRUE))
.and(a.fileName.in(issueTypeIconsToReplace.values())))
.groupBy(a.fileName)
.map(a.fileName, a.id.min());
.where(it.avatar.eq(iconToReplaceId))
.set(it.avatar, replacementIconId)
.execute();
.delete(a)
.where(a.avatarType.eq(ISSUE_TYPE_AVATAR)
.and(a.systemAvatar.eq(TRUE))
.and(a.fileName.in(issueTypeIconsToReplace.keySet())))
.execute();
.update(a)
.where(a.avatarType.eq(ISSUE_TYPE_AVATAR)
.and(a.systemAvatar.eq(TRUE))
.and(a.fileName.eq(oldIconName)))
.set(a.fileName, newIconName)
.from(a)

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public List getByIssue(final Issue issue)
{
checkArgument(issue != null, "Cannot resolve worklogs for null issue.");
final BooleanExpression query = issue.getId() != null ?
WORKLOG.issue.eq(issue.getId()) : WORKLOG.issue.isNull();
return dbConnectionManager.executeQuery(dc -> dc.newSqlQuery()
.from(WORKLOG)
.leftJoin(QProjectRole.PROJECT_ROLE)
.on(QProjectRole.PROJECT_ROLE.id.eq(WORKLOG.rolelevel))
.where(query)
.orderBy(WORKLOG.created.asc())
.list(WORKLOG_PROJECT_ROLE_TUPLE)
).stream()
.map(t -> queryDSLWorklogFactory.createWorklog(issue, t))
.collect(Collectors.toList());
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
public void OrderBy() {
JPQLQuery query = query().from(cat1).where(cat1.alive);
NumberSubQuery subquery = sub().from(cat).where(cat.mate.id.eq(cat1.id)).unique(cat.floatProperty.avg());
query.orderBy(subquery.subtract(-1.0f).asc());
assertEquals("select cat1 from Cat cat1 where cat1.alive order by (select avg(cat.floatProperty) from Cat cat where cat.mate.id = cat1.id) - ?1 asc",
query.toString().replace("\n", " "));
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
@Ignore // isn't a valid JPQL query
public void Subquery_UniqueResult() {
QCat cat2 = new QCat("cat2");
BooleanExpression exists = new JPASubQuery().from(cat2).where(cat2.eyecolor.isNotNull()).exists();
assertNotNull(query().from(cat)
.where(cat.breed.eq(0).not())
.singleResult(new QCatSummary(cat.breed.count(), exists)));
}

代码示例来源:origin: org.gvnix/org.gvnix.web.datatables

Number value = NumberUtils.createNumber((String) searchObj);
if (StringUtils.equalsIgnoreCase(operator, OPERATOR_GOE)) {
return numberExpression.goe(value);
return numberExpression.gt(value);
return numberExpression.like((String) searchObj);
return numberExpression.loe(value);
return numberExpression.lt(value);

代码示例来源:origin: odrotbohm/repositories-deepdive

@Override
public void removeProductsMoreExpensiveThan(BigDecimal price) {
delete(product).where(product.price.gt(price)).execute();
}
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
public void Order() {
NumberPath weight = new NumberPath(Double.class, "weight");
query().from(cat).orderBy(weight.asc()).list(cat.bodyWeight.as(weight));
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
public void Where_5() throws Exception {
query().from(an).where(
an.bodyWeight.gt(10),
an.bodyWeight.lt(100).or(an.bodyWeight.isNull()))
.parse();
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
public void GroupingOperationsAndNullChecks() {
// in, not in, between, is null, is not null, is empty, is not empty,
// member of and not member of
// in,
// not in,
// between,
// is null,
// is not null,
// is empty,
// is not empty,
// member of
// not member of
kitten.in(cat.kittens);
kitten.in(cat.kittens).not();
kitten.bodyWeight.between(10, 20);
kitten.bodyWeight.isNull();
kitten.bodyWeight.isNotNull();
cat.kittens.isEmpty();
cat.kittens.isNotEmpty();
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
@Nonnull
public Set getAllRoleActorsForUser(@Nullable final ApplicationUser user)
{
if (user == null)
{
return ImmutableSet.of();
}
final List groupNames = groupManager.getGroupNamesForUser(user).stream().map(IdentifierUtils::toLowerCase).collect(Collectors.toList());
final ImmutableSet.Builder resultsBuilder = ImmutableSet.builder();
dbConnectionManager.execute(dbConnection ->
{
final QProjectRoleActor pra = new QProjectRoleActor("pra");
//We are not going to filter group names here because we need to compare them using IdentifierUtils.toLowerCase
try (CloseableIterator roleActorTuples = dbConnection.newSqlQuery().
from(pra).
where(pra.roletype.eq(ProjectRoleActor.GROUP_ROLE_ACTOR_TYPE).and(pra.pid.isNotNull())).
iterate(Projections.tuple(pra.id, pra.pid, pra.projectroleid, pra.roletype, pra.roletypeparameter)))
{
addMatchingActors(roleActorTuples, pra, groupNames, resultsBuilder);
}
});
return resultsBuilder.build();
}

代码示例来源:origin: com.atlassian.jira/jira-core

private void deleteMinusOneUserLocaleProperty(List ids, DbConnection dbConnection)
{
QOSPropertyEntry propertyEntry = QOSPropertyEntry.O_S_PROPERTY_ENTRY;
QOSPropertyString propertyString = QOSPropertyString.O_S_PROPERTY_STRING;
dbConnection.delete(propertyString).where(propertyString.id.in(ids)).execute();
dbConnection.delete(propertyEntry).where(propertyEntry.id.in(ids)).execute();
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
public void OrderExpressionInFunctionalWay() {
cat.bodyWeight.asc();
cat.bodyWeight.add(kitten.bodyWeight).asc();
}

推荐阅读
author-avatar
hhxsv5
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有