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


Java Tuple.get方法代码示例

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


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

示例1: create

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
public Thing create(Tuple tuple, Query query, DataSize dataSize) {
    Set<Property> select = query == null ? Collections.emptySet() : query.getSelect();

    Thing entity = new Thing();
    entity.setName(tuple.get(qInstance.name));
    entity.setDescription(tuple.get(qInstance.description));

    UUID id = tuple.get(qInstance.id);
    if (id != null) {
        entity.setId(new UuidId(tuple.get(qInstance.id)));
    }

    if (select.isEmpty() || select.contains(EntityProperty.Properties)) {
        String props = tuple.get(qInstance.properties);
        dataSize.increase(props == null ? 0 : props.length());
        entity.setProperties(jsonToObject(props, Map.class));
    }

    return entity;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:22,代码来源:PropertyHelper.java

示例2: create

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
public Thing create(Tuple tuple, Query query, DataSize dataSize) {
    Set<Property> select = query == null ? Collections.emptySet() : query.getSelect();

    Thing entity = new Thing();
    entity.setName(tuple.get(qInstance.name));
    entity.setDescription(tuple.get(qInstance.description));

    Long id = tuple.get(qInstance.id);
    if (id != null) {
        entity.setId(new LongId(tuple.get(qInstance.id)));
    }

    if (select.isEmpty() || select.contains(EntityProperty.Properties)) {
        String props = tuple.get(qInstance.properties);
        dataSize.increase(props == null ? 0 : props.length());
        entity.setProperties(jsonToObject(props, Map.class));
    }

    return entity;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:22,代码来源:PropertyHelper.java

示例3: create

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
public ObservedProperty create(Tuple tuple, Query query, DataSize dataSize) {
    Set<Property> select = query == null ? Collections.emptySet() : query.getSelect();

    ObservedProperty entity = new ObservedProperty();
    entity.setDefinition(tuple.get(qInstance.definition));
    entity.setDescription(tuple.get(qInstance.description));
    String id = tuple.get(qInstance.id);
    if (id != null) {
        entity.setId(new StringId(tuple.get(qInstance.id)));
    }

    entity.setName(tuple.get(qInstance.name));

    if (select.isEmpty() || select.contains(EntityProperty.Properties)) {
        String props = tuple.get(qInstance.properties);
        entity.setProperties(jsonToObject(props, Map.class));
    }

    return entity;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:22,代码来源:PropertyHelper.java

示例4: map

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
protected Facility map(Tuple row) {
    Facility facility = mapFacility(row, new Facility());
    facility.contacts = new FacilityContacts(
            row.get(qFacility.emergencyContactId),
            row.get(qFacility.operatorContactId),
            row.get(qFacility.serviceContactId)
    );
    facility.paymentInfo.detail = paymentInfoDetailMapping.map(row);
    facility.paymentInfo.url = paymentInfoUrlMapping.map(row);

    facility.openingHours.info = openingHoursInfoMapping.map(row);
    facility.openingHours.url = openingHoursUrlMapping.map(row);

    return facility;
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:17,代码来源:FacilityDao.java

示例5: map

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
protected Contact map(Tuple row) {
    Long id = row.get(qContact.id);
    if (id == null) {
        return null;
    }
    Contact contact = new Contact();
    contact.id = id;
    contact.operatorId = row.get(qContact.operatorId);
    contact.email = row.get(qContact.email);
    contact.phone = row.get(qContact.phone);
    contact.name = nameMapping.map(row);
    contact.address = addressMapping.map(row);
    contact.openingHours = openingHoursMapping.map(row);
    contact.info = infoMapping.map(row);
    return contact;
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:18,代码来源:ContactDao.java

示例6: setEndDateForPreviousStateHistoryEntry

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
private void setEndDateForPreviousStateHistoryEntry(long facilityId, DateTime currentDate) {
    final Tuple lastHistoryEntry = queryFactory.query()
            .select(qFacilityStatusHistory.id, qFacilityStatusHistory.startTs)
            .from(qFacilityStatusHistory)
            .where(qFacilityStatusHistory.facilityId.eq(facilityId))
            .orderBy(qFacilityStatusHistory.endTs.desc().nullsFirst())
            .fetchFirst();

    if (lastHistoryEntry != null) {
        Long lastHistoryEntryId = lastHistoryEntry.get(qFacilityStatusHistory.id);
        final DateTime lastEntryStartTs = lastHistoryEntry.get(qFacilityStatusHistory.startTs);
        validateTimestamp(facilityId, currentDate, lastEntryStartTs, lastHistoryEntryId);
        queryFactory.update(qFacilityStatusHistory)
                .set(qFacilityStatusHistory.endTs, currentDate)
                .where(qFacilityStatusHistory.id.eq(lastHistoryEntryId))
                .execute();
    }
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:19,代码来源:FacilityHistoryDao.java

示例7: setEndDateForPreviousCapacityHistoryEntry

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
private void setEndDateForPreviousCapacityHistoryEntry(long facilityId, DateTime currentDate) {
    final Tuple lastHistoryEntry = queryFactory.query()
            .select(qFacilityCapacityHistory.id, qFacilityCapacityHistory.startTs)
            .from(qFacilityCapacityHistory)
            .where(qFacilityCapacityHistory.facilityId.eq(facilityId))
            .orderBy(qFacilityCapacityHistory.endTs.desc().nullsFirst())
            .fetchFirst();

    if (lastHistoryEntry != null) {
        Long lastHistoryEntryId = lastHistoryEntry.get(qFacilityCapacityHistory.id);
        final DateTime lastEntryStartTs = lastHistoryEntry.get(qFacilityCapacityHistory.startTs);
        validateTimestamp(facilityId, currentDate, lastEntryStartTs, lastHistoryEntryId);
        queryFactory.update(qFacilityCapacityHistory)
                .set(qFacilityCapacityHistory.endTs, currentDate)
                .where(qFacilityCapacityHistory.id.eq(lastHistoryEntryId))
                .execute();
    }
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:19,代码来源:FacilityHistoryDao.java

示例8: predictionMapping

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
private static MappingProjection<PredictionBatch> predictionMapping(DateTime timeWithFullPrecision) {
    DateTime time = toPredictionResolution(timeWithFullPrecision);
    Path<Integer> spacesAvailableColumn = spacesAvailableAt(time);
    return new MappingProjection<PredictionBatch>(PredictionBatch.class,
            qPrediction.facilityId,
            qPrediction.capacityType,
            qPrediction.usage,
            qPrediction.start,
            spacesAvailableColumn) {
        @Override
        protected PredictionBatch map(Tuple row) {
            PredictionBatch pb = new PredictionBatch();
            pb.utilizationKey = new UtilizationKey(
                    row.get(qPrediction.facilityId),
                    row.get(qPrediction.capacityType),
                    row.get(qPrediction.usage)
            );
            pb.sourceTimestamp = row.get(qPrediction.start);
            Integer spacesAvailable = row.get(spacesAvailableColumn);
            if (spacesAvailable != null) {
                pb.predictions.add(new Prediction(time, spacesAvailable));
            }
            return pb;
        }
    };
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:27,代码来源:PredictionDao.java

示例9: getPropertyValue

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@SuppressWarnings("unused")
protected Object getPropertyValue(PropertyPath path, Tuple tuple) {
    String type = firstNonNull(tuple.get(options.property.type), "N");
    String str = tuple.get(options.property.str);
    Long nbr = tuple.get(options.property.nbr);

    switch (type.charAt(0)) {
        case 'O': return Persistent.object(str);
        case 'A': return Persistent.array();
        case 's': return str;
        case 'b': return nbr != null ? nbr != 0 : null;
        case 'l': return nbr;
        case 'd': return nbr != null ? Double.longBitsToDouble(nbr) : null;
        case 'D': return !isNullOrEmpty(str) ? new BigDecimal(str) : null;
        case 'N': return Persistent.NULL;
        case 'n': return null;
        default:
            throw new IllegalArgumentException("Unsupported type: " + type);
    }
}
 
开发者ID:ssaarela,项目名称:javersion,代码行数:21,代码来源:AbstractVersionStoreJdbc.java

示例10: fromFunction

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
public static <T, F> MappingProjection<F> fromFunction(final Class<T> inputClazz, Expression<T> inputExpression, Class<F> outputClazz,
		final Function<? super T, ? extends F> function) {
	return new MappingProjection<F>(outputClazz, inputExpression) {
		private static final long serialVersionUID = 1L;
		@Override
		protected F map(Tuple row) {
			T fromValue = row.get(0, inputClazz);
			return function.apply(fromValue);
		}
	};
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:12,代码来源:Expressions2.java

示例11: mapFacility

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
private static <T extends FacilityInfo> T mapFacility(Tuple row, T facility) {
    Long id = row.get(qFacility.id);
    if (id == null) {
        return null;
    }
    facility.id = id;
    facility.location = row.get(qFacility.location);
    facility.name = nameMapping.map(row);
    facility.operatorId = row.get(qFacility.operatorId);
    facility.status = row.get(qFacility.status);
    facility.statusDescription = statusDescriptionMapping.map(row);
    facility.pricingMethod = row.get(qFacility.pricingMethod);

    if (row.get(qFacility.usageParkAndRide)) {
        facility.usages.add(PARK_AND_RIDE);
    }
    if (row.get(qFacility.usageHsl)) {
        facility.usages.add(HSL_TRAVEL_CARD);
    }
    if (row.get(qFacility.usageCommercial)) {
        facility.usages.add(COMMERCIAL);
    }

    mapCapacity(facility.builtCapacity, CAR, row.get(qFacility.capacityCar));
    mapCapacity(facility.builtCapacity, DISABLED, row.get(qFacility.capacityDisabled));
    mapCapacity(facility.builtCapacity, ELECTRIC_CAR, row.get(qFacility.capacityElectricCar));
    mapCapacity(facility.builtCapacity, MOTORCYCLE, row.get(qFacility.capacityMotorcycle));
    mapCapacity(facility.builtCapacity, BICYCLE, row.get(qFacility.capacityBicycle));
    mapCapacity(facility.builtCapacity, BICYCLE_SECURE_SPACE, row.get(qFacility.capacityBicycleSecureSpace));

    return facility;
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:33,代码来源:FacilityDao.java

示例12: map

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
protected Address map(Tuple row) {
    Address address = new Address();
    address.streetAddress = streetAddress.map(row);
    address.postalCode = row.get(postalCode);
    address.city = city.map(row);
    return address;
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:9,代码来源:AddressMapping.java

示例13: map

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
protected User map(Tuple row) {
    User user = new User();
    user.id = row.get(qUser.id);
    user.username = row.get(qUser.username);
    user.role = row.get(qUser.role);
    user.operatorId = row.get(qUser.operatorId);
    return user;
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:10,代码来源:UserDao.java

示例14: map

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
protected UnavailableCapacity map(Tuple row) {
    final UnavailableCapacity uc = new UnavailableCapacity();
    uc.capacityType = row.get(qUnavailableCapacityHistory.capacityType);
    uc.usage = row.get(qUnavailableCapacityHistory.usage);
    uc.capacity = row.get(qUnavailableCapacityHistory.capacity);
    return uc;
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:9,代码来源:FacilityHistoryDao.java

示例15: map

import com.querydsl.core.Tuple; //导入方法依赖的package包/类
@Override
protected Region map(Tuple row) {
    Region region = new Region();
    region.id = row.get(qRegion.id);
    region.area = row.get(qRegion.area);
    region.name = nameMapping.map(row);
    return region;
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:9,代码来源:RegionDao.java


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