本文整理汇总了Java中com.mysema.query.types.ConstantImpl类的典型用法代码示例。如果您正苦于以下问题:Java ConstantImpl类的具体用法?Java ConstantImpl怎么用?Java ConstantImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConstantImpl类属于com.mysema.query.types包,在下文中一共展示了ConstantImpl类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleListLayerStyles
import com.mysema.query.types.ConstantImpl; //导入依赖的package包/类
private CompletableFuture<List<Style>> handleListLayerStyles (final ListLayerStyles listLayerStyles) {
String layerId = listLayerStyles.layerId();
log.debug("handleListLayerStyles layerId: " + layerId);
return db.transactional(tx -> tx
.query()
.from(genericLayer)
.where(genericLayer.identification.eq(layerId))
.singleResult(genericLayer.id)
.thenCompose(
glId -> {
log.debug("genericlayer id: " + glId.get());
return tx
.query()
.from(style, leafLayer, layerStyle)
//.join(leafLayer).on(genericLayer.id.eq(leafLayer.genericLayerId))
.where(leafLayer.genericLayerId.eq(glId.get()).and(layerStyle.layerId.eq(leafLayer.id))
.and(layerStyle.styleId.eq(style.id)))
.orderBy(layerStyle.styleOrder.asc())
.list(new QStyle(style.identification, style.name, style.styleSchemeType, style.definition, style.styleType, ConstantImpl.create(true)))
.thenApply(this::toList);
}));
}
示例2: everyPagePredicate
import com.mysema.query.types.ConstantImpl; //导入依赖的package包/类
@Test
@Ignore
public void everyPagePredicate() {
int pageSize = 25;
int totalPages = N / 25;
Stopwatch sw = new Stopwatch();
for (int pageNumber = 0; pageNumber < N / pageSize; pageNumber++) {
sw.start();
Page<PagingAndSortingEntity> page = repository.findAll(
BooleanOperation.create(
Ops.EQ,
new ConstantImpl<String>("foo"),
new ConstantImpl<String>("foo")),
new PageableImpl(pageNumber, 25, 0, null));
Assert.assertEquals(pageNumber, page.getNumber());
Assert.assertEquals(pageSize, page.getSize());
Assert.assertEquals(totalPages, page.getTotalPages());
LOGGER.info("Fetched page {} in {}ms...", pageNumber, sw.elapsed(TimeUnit.MILLISECONDS));
sw.reset();
}
}
示例3: set
import com.mysema.query.types.ConstantImpl; //导入依赖的package包/类
@Override
public <T> AsyncSQLUpdateClause set(Path<T> path, T value) {
if (value instanceof Expression<?>) {
columns.add(path);
values.add((Expression<?>)value);
} else if (value != null) {
columns.add(path);
values.add(ConstantImpl.create(value));
} else {
setNull(path);
}
return this;
}
示例4: handleGetLayer
import com.mysema.query.types.ConstantImpl; //导入依赖的package包/类
private CompletableFuture<Optional<Layer>> handleGetLayer (String layerId) {
log.debug("handleGetLayer: " + layerId);
List<Expression<?>> layerColumns = new ArrayList<>();
layerColumns.addAll(Arrays.asList(genericLayer.all()));
layerColumns.addAll(Arrays.asList(tiledLayer.all()));
layerColumns.addAll(Arrays.asList(leafLayer.all()));
layerColumns.addAll(Arrays.asList(dataset.all()));
layerColumns.add (confidentialExpression ());
layerColumns.add (wmsOnlyExpression ());
return db.transactional(tx ->
tx.query()
.from(genericLayer)
.join(leafLayer).on(genericLayer.id.eq(leafLayer.genericLayerId))
.join(dataset).on(leafLayer.datasetId.eq(dataset.id))
.leftJoin(tiledLayer).on(tiledLayer.genericLayerId.eq(genericLayer.id))
.where(genericLayer.identification.eq(layerId))
.singleResult(layerColumns.toArray (new Expression<?>[layerColumns.size ()])).<Optional<Layer>>thenCompose(optionalLayer -> {
if(optionalLayer.isPresent()) {
Tuple layer = optionalLayer.get();
log.debug("generic layer id: " + layer.get(genericLayer.id));
return tx.query()
.from(leafLayerKeyword)
.where(leafLayerKeyword.leafLayerId.eq(layer.get(leafLayer.id)))
.list(leafLayerKeyword.keyword).thenCompose(keywords -> {
log.debug("tiled layer id: " + layer.get(tiledLayer.id));
boolean hasTiledLayer = layer.get(tiledLayer.genericLayerId) != null;
log.debug("tiled layer glId: " + layer.get(tiledLayer.genericLayerId) + " = " + hasTiledLayer);
CompletableFuture<TypedList<String>> mimeformatsQuery;
if(hasTiledLayer) {
mimeformatsQuery = tx.query()
.from(tiledLayerMimeformat)
.where(tiledLayerMimeformat.tiledLayerId.eq(layer.get(tiledLayer.id)))
.list(tiledLayerMimeformat.mimeformat);
} else {
mimeformatsQuery = f.successful(new TypedList<>(String.class, Collections.emptyList()));
}
return mimeformatsQuery.<Optional<Layer>>thenCompose(mimeFormats ->
tx.query()
.from(genericLayer)
.join(leafLayer).on(genericLayer.id.eq(leafLayer.genericLayerId))
.join(layerStyle).on(layerStyle.layerId.eq(leafLayer.id))
.join(style).on(layerStyle.styleId.eq(style.id))
.where(genericLayer.identification.eq(layerId))
.orderBy(layerStyle.styleOrder.asc())
.list(new QStyle(style.identification, style.name, style.styleSchemeType, style.definition,style.styleType, ConstantImpl.create(true)))
.<Optional<Layer>>thenApply(styles ->
Optional.of(new Layer(
layer.get(genericLayer.identification),
layer.get(genericLayer.name),
layer.get(genericLayer.title),
layer.get(genericLayer.abstractCol),
layer.get(dataset.identification),
layer.get(dataset.name),
(hasTiledLayer
? new TiledLayer(
layer.get(genericLayer.identification),
layer.get(genericLayer.name),
layer.get(tiledLayer.metaWidth),
layer.get(tiledLayer.metaHeight),
layer.get(tiledLayer.expireCache),
layer.get(tiledLayer.expireClients),
layer.get(tiledLayer.gutter),
mimeFormats.list())
: null)
,
keywords.list(), styles.list(),
layer.get (confidentialPath),
layer.get (wmsOnlyPath)
))));
});
} else {
return f.successful(Optional.empty());
}
}));
}