本文整理汇总了Java中com.querydsl.core.types.dsl.NumberPath类的典型用法代码示例。如果您正苦于以下问题:Java NumberPath类的具体用法?Java NumberPath怎么用?Java NumberPath使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NumberPath类属于com.querydsl.core.types.dsl包,在下文中一共展示了NumberPath类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replacementWeekdaySubSelect
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private static Expression<Long> replacementWeekdaySubSelect(final NumberPath<Long> workSchemeId,
final Expression<Long> userId, final DatePath<Date> date) {
QPublicHoliday qPublicHoliday = new QPublicHoliday("exp_work_repl_pubhday");
QUserHolidayScheme qUserHolidayScheme = new QUserHolidayScheme("exp_work_repl_uhsch");
QDateRange qDateRange = new QDateRange("exp_work_repl_uhschdr");
SQLQuery<Long> query = new SQLQuery<Long>();
query.select(weekdaySumForReplacementDay(workSchemeId, qPublicHoliday.date.dayOfWeek()))
.from(qPublicHoliday)
.innerJoin(qUserHolidayScheme)
.on(qUserHolidayScheme.holidaySchemeId.eq(qPublicHoliday.holidaySchemeId))
.innerJoin(qDateRange).on(qDateRange.dateRangeId.eq(qUserHolidayScheme.dateRangeId))
.where(qPublicHoliday.replacementDate.eq(date)
.and(qUserHolidayScheme.userId.eq(userId))
.and(qDateRange.startDate.loe(date))
.and(qDateRange.endDateExcluded.gt(date)));
return query;
}
示例2: fetchChanged
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private List<HuntingClubAreaChangedExcelView.ExcelRow> fetchChanged(final @Nonnull GISZone zoneEntity) {
final SQZonePalsta zonePalsta = new SQZonePalsta("zp");
final SQPalstaalue pa1 = new SQPalstaalue("pa1"); // Current
final SQPalstaalue pa2 = new SQPalstaalue("pa2"); // New
final NumberPath<Integer> pathPalstaId = zonePalsta.palstaId;
final NumberPath<Integer> pathPalstaIdNew = zonePalsta.newPalstaId;
final NumberPath<Long> pathPalstaTunnus = zonePalsta.palstaTunnus;
final NumberPath<Long> pathPalstaTunnusNew = zonePalsta.newPalstaTunnus;
final NumberPath<Double> pathAreaDiff = zonePalsta.diffArea;
final NumberExpression<Double> pathAreaSize = zonePalsta.geom.asMultiPolygon().area();
return sqlQueryFactory
.from(zonePalsta)
.leftJoin(pa1).on(pa1.id.eq(pathPalstaId))
.leftJoin(pa2).on(pa2.id.eq(pathPalstaIdNew))
.where(zonePalsta.zoneId.eq(zoneEntity.getId())
.and(zonePalsta.isChanged.isTrue()))
.select(Projections.constructor(HuntingClubAreaChangedExcelView.ExcelRow.class,
pathPalstaTunnus, pathPalstaTunnusNew,
pathAreaSize, pathAreaDiff))
.orderBy(pathPalstaTunnus.asc(), pathPalstaId.asc())
.fetch();
}
示例3: findAmendmentAmountsByOriginalPermitId
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private Map<Long, Float> findAmendmentAmountsByOriginalPermitId(final List<HarvestPermit> originalPermits,
final int speciesCode,
final int huntingYear) {
final QHarvestPermitSpeciesAmount speciesAmount = QHarvestPermitSpeciesAmount.harvestPermitSpeciesAmount;
final QGameSpecies species = QGameSpecies.gameSpecies;
final QHarvestPermit amendmentPermit = new QHarvestPermit("amendmentPermit");
final NumberPath<Long> originalPermitId = amendmentPermit.originalPermit.id;
final NumberExpression<Float> sumOfAmendmentPermitAmounts = speciesAmount.amount.sum();
return jpqlQueryFactory.select(originalPermitId, sumOfAmendmentPermitAmounts)
.from(speciesAmount)
.join(speciesAmount.gameSpecies, species)
.join(speciesAmount.harvestPermit, amendmentPermit)
.where(amendmentPermit.originalPermit.in(originalPermits),
species.officialCode.eq(speciesCode),
speciesAmount.validOnHuntingYear(huntingYear))
.groupBy(originalPermitId)
.transform(groupBy(originalPermitId).as(sumOfAmendmentPermitAmounts));
}
示例4: countClubHarvestAmountGroupByGameSpeciesId
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
/**
* Filter criteria includes:
* - If harvest is linked to groups hunting day, it is included always
* Otherwise:
* - Person must have occupation in given club
* - Occupation must be valid on the day of harvest
* - If harvest.harvest_report_required=true then harvest must have accepted harvest report
* - Harvest species must not be any the given mooselikes (those are included by hunting days)
* - Harvest location must intersect with active area for club
*/
@Override
@Transactional(readOnly = true)
public Map<Long, Integer> countClubHarvestAmountGroupByGameSpeciesId(final HuntingClub huntingClub,
final int huntingYear,
final Interval interval,
final Set<Integer> mooselike) {
final SQHarvest harvest = SQHarvest.harvest;
final BooleanExpression predicate1 = harvest.groupHuntingDayId.isNull()
.and(harvest.harvestId.in(harvestOfClubMemberInsideClubHuntingArea(
huntingClub.getId(), interval, huntingYear, mooselike)));
final BooleanExpression predicate2 = harvest.groupHuntingDayId.isNotNull()
.and(harvest.groupHuntingDayId.in(harvestLinkedToClubHuntingDay(huntingClub.getId(), huntingYear)));
final NumberPath<Long> keyPath = harvest.gameSpeciesId;
final NumberExpression<Integer> valuePath = harvest.amount.sum();
return sqlQueryFactory.from(harvest)
.select(keyPath, valuePath)
.where(predicate1.or(predicate2))
.groupBy(keyPath)
.transform(GroupBy.groupBy(keyPath).as(valuePath));
}
示例5: checkType
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
public static <T extends Expression<?>> T checkType(Class<T> expectedClazz, Expression<?> input, boolean canCast) {
if (expectedClazz.isAssignableFrom(input.getClass())) {
LOGGER.debug("Is {}: {} ({} -- {})", expectedClazz.getName(), input, input.getClass().getName(), input.getType().getName());
return expectedClazz.cast(input);
} else {
if (canCast && StringExpression.class.equals(expectedClazz) && input instanceof NumberPath) {
NumberPath numberPath = (NumberPath) input;
return (T) numberPath.stringValue();
}
LOGGER.debug("Not a {}: {} ({} -- {})", expectedClazz.getName(), input, input.getClass().getName(), input.getType().getName());
throw new IllegalArgumentException("Could not convert parameter of type " + input.getClass().getName() + " to type " + expectedClazz.getName());
}
}
示例6: createPointWithDefaultSRID
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
public static GeometryExpression<?> createPointWithDefaultSRID(@Nonnull final NumberPath<Integer> longitude,
@Nonnull final NumberPath<Integer> latitude) {
Objects.requireNonNull(longitude, "longitude must not be null");
Objects.requireNonNull(latitude, "latitude must not be null");
final StringExpression point = longitude.stringValue()
.prepend(constant("POINT("))
.concat(constant(" "))
.concat(latitude.stringValue())
.concat(constant(")"));
return GeometryExpressions.setSRID(fromText(point), SRID.ETRS_TM35FIN.getValue());
}
示例7: exactWorkSubSelect
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private static Expression<Long> exactWorkSubSelect(final NumberPath<Long> workSchemeId,
final DatePath<Date> date) {
QExactWork qExactWork = new QExactWork("exp_work_exact_work");
SQLQuery<Long> query = new SQLQuery<Long>();
query.select(qExactWork.duration.sum()).from(qExactWork)
.where(qExactWork.workSchemeId.eq(workSchemeId).and(qExactWork.date.eq(date)));
return query;
}
示例8: nonHolidayWeekdaySubSelect
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private static Expression<Long> nonHolidayWeekdaySubSelect(final NumberPath<Long> workSchemeId,
final Expression<Long> userId, final DatePath<Date> date) {
QWeekdayWork qWeekdayWork = new QWeekdayWork("exp_work_nh_wdw");
SQLQuery<Long> query = new SQLQuery<>();
query.select(qWeekdayWork.duration.sum()).from(qWeekdayWork)
.where(qWeekdayWork.workSchemeId.eq(workSchemeId)
.and(date.dayOfWeek()
.eq(Expressions.path(Integer.class, qWeekdayWork.weekday.getMetadata())))
.and(noHolidayExistsSubSelect(userId, date)));
return query;
}
示例9: weekdaySumForReplacementDay
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private static Expression<Long> weekdaySumForReplacementDay(final NumberPath<Long> workSchemeId,
final NumberExpression<Integer> dayOfWeek) {
QWeekdayWork qWeekdayWork = new QWeekdayWork("exp_work_repl_wdw");
SQLQuery<Long> query = new SQLQuery<>();
query.select(qWeekdayWork.duration.sum())
.from(qWeekdayWork)
.where(qWeekdayWork.workSchemeId.eq(workSchemeId)
.and(
Expressions.path(Integer.class, qWeekdayWork.weekday.getMetadata()).eq(dayOfWeek)));
return query;
}
示例10: customize
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QCustomer cust) {
// bindings.bind(cust.firstName).first(StringExpression::containsIgnoreCase);
bindings
.bind(String.class)
.first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
bindings
.bind(Long.class)
.first((SingleValueBinding<NumberPath<Long>, Long>) NumberExpression::goe);
// bindings.excluding(cust.lastName);
}
示例11: evaluate
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
@Override
public BooleanExpression evaluate(NumberPath path, ComparisonNode comparisonNode) {
ComparisonOperator comparisonOperator = comparisonNode.getOperator();
List<String> arguments = comparisonNode.getArguments();
Number firstNumberArg = convertToNumber(path, arguments.get(0));
if (EQUAL.equals(comparisonOperator)) {
return firstNumberArg == null ? path.isNull() : path.eq(firstNumberArg);
} else if (NOT_EQUAL.equals(comparisonOperator)) {
return firstNumberArg == null ? path.isNotNull() : path.ne(firstNumberArg);
} else if (IN.equals(comparisonOperator)) {
return path.in(convertToNumberArguments(path, arguments));
} else if (NOT_IN.equals(comparisonOperator)) {
return path.notIn(convertToNumberArguments(path, arguments));
} else if (GREATER_THAN.equals(comparisonOperator)) {
return path.gt(firstNumberArg);
} else if (GREATER_THAN_OR_EQUAL.equals(comparisonOperator)) {
return path.goe(firstNumberArg);
} else if (LESS_THAN.equals(comparisonOperator)) {
return path.lt(firstNumberArg);
} else if (LESS_THAN_OR_EQUAL.equals(comparisonOperator)) {
return path.loe(firstNumberArg);
}
throw new UnsupportedRqlOperatorException(comparisonNode, path.getClass());
}
示例12: convertToNumberArguments
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private List<Number> convertToNumberArguments(NumberPath path, List<String> arguments) {
List<Number> numberArgs = Lists.newArrayList();
for (String arg : arguments) {
numberArgs.add(convertToNumber(path, arg));
}
return numberArgs;
}
示例13: populateCapacity
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private void populateCapacity(NumberPath<Integer> path, Integer value, StoreClause store) {
if (value == null || value < 1) {
store.setNull(path);
} else {
store.set(path, value);
}
}
示例14: populateCapacity
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
private static void populateCapacity(NumberPath<Integer> path, Integer value, StoreClause store) {
if (value == null || value < 1) {
store.setNull(path);
} else {
store.set(path, value);
}
}
示例15: getPrimaryKey
import com.querydsl.core.types.dsl.NumberPath; //导入依赖的package包/类
@Override
public NumberPath<Long> getPrimaryKey() {
return qInstance.id;
}