本文整理汇总了Java中com.querydsl.sql.dml.SQLInsertClause.addBatch方法的典型用法代码示例。如果您正苦于以下问题:Java SQLInsertClause.addBatch方法的具体用法?Java SQLInsertClause.addBatch怎么用?Java SQLInsertClause.addBatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.querydsl.sql.dml.SQLInsertClause
的用法示例。
在下文中一共展示了SQLInsertClause.addBatch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertPricing
import com.querydsl.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void insertPricing(long facilityId, List<Pricing> pricing) {
if (pricing != null && !pricing.isEmpty()) {
SQLInsertClause insert = queryFactory.insert(qPricing);
for (Pricing price : pricing) {
insert.set(qPricing.facilityId, facilityId)
.set(qPricing.capacityType, price.capacityType)
.set(qPricing.usage, price.usage)
.set(qPricing.maxCapacity, price.maxCapacity)
.set(qPricing.dayType, price.dayType)
.set(qPricing.fromTime, price.time.from)
.set(qPricing.untilTime, price.time.until);
pricingPriceMapping.populate(price.price, insert);
insert.addBatch();
}
insert.execute();
}
}
示例2: insertPorts
import com.querydsl.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void insertPorts(long facilityId, Map<Integer, Port> addedPorts) {
if (addedPorts != null && !addedPorts.isEmpty()) {
SQLInsertClause insert = queryFactory.insert(qPort);
for (Entry<Integer, Port> entry : addedPorts.entrySet()) {
populate(facilityId, entry.getKey(), entry.getValue(), insert);
insert.addBatch();
}
insert.execute();
}
}
示例3: insertUnavailableCapacity
import com.querydsl.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void insertUnavailableCapacity(long facilityId, List<UnavailableCapacity> unavailableCapacities) {
if (unavailableCapacities != null && !unavailableCapacities.isEmpty()) {
SQLInsertClause insert = queryFactory.insert(qUnavailableCapacity);
for (UnavailableCapacity unavailableCapacity : unavailableCapacities) {
insert.set(qUnavailableCapacity.facilityId, facilityId)
.set(qUnavailableCapacity.capacityType, unavailableCapacity.capacityType)
.set(qUnavailableCapacity.usage, unavailableCapacity.usage)
.set(qUnavailableCapacity.capacity, unavailableCapacity.capacity);
insert.addBatch();
}
insert.execute();
}
}
示例4: insertAliases
import com.querydsl.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void insertAliases(long facilityId, Collection<String> aliases) {
if (aliases != null && !aliases.isEmpty()) {
SQLInsertClause insertBatch = queryFactory.insert(qAlias);
for (String alias : aliases) {
insertBatch.set(qAlias.facilityId, facilityId);
insertBatch.set(qAlias.alias, alias);
insertBatch.addBatch();
}
insertBatch.execute();
}
}
示例5: insertHubFacilities
import com.querydsl.sql.dml.SQLInsertClause; //导入方法依赖的package包/类
private void insertHubFacilities(long hubId, Set<Long> facilityIds) {
if (facilityIds != null && !facilityIds.isEmpty()) {
SQLInsertClause insertBatch = queryFactory.insert(qHubFacility);
for (Long facilityId : facilityIds) {
insertBatch.set(qHubFacility.hubId, hubId);
insertBatch.set(qHubFacility.facilityId, facilityId);
insertBatch.addBatch();
}
insertBatch.execute();
}
}