本文整理了Java中com.mysema.query.types.path.NumberPath
类的一些代码示例,展示了NumberPath
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NumberPath
类的具体详情如下:
包路径:com.mysema.query.types.path.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
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
{
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
NumberExpression
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
{
final List
.orderBy(PRIORITY.sequence.asc()).list(PRIORITY));
final 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
{
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
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
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
{
if (user == null)
{
return ImmutableSet.of();
}
final List
final 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
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
{
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();
}