本文整理了Java中javax.persistence.criteria.Root.joinMap
方法的一些代码示例,展示了Root.joinMap
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Root.joinMap
方法的具体详情如下:
包路径:javax.persistence.criteria.Root
类名称:Root
方法名:joinMap
暂无
代码示例来源:origin: org.omnifaces/omnipersistence
@Override
@SuppressWarnings("hiding")
public <X, K, V> MapJoin<X, K, V> joinMap(String attributeName, JoinType jt) {
return getWrapped().joinMap(attributeName, jt);
}
代码示例来源:origin: org.omnifaces/omnipersistence
@Override
@SuppressWarnings("hiding")
public <X, K, V> MapJoin<X, K, V> joinMap(String attributeName) {
return getWrapped().joinMap(attributeName);
}
代码示例来源:origin: org.jboss.pnc/spi
public static Predicate<BuildRecord> withAttribute(String key, String value) {
return (root, query, cb) -> {
MapJoin<Object, Object, Object> mapJoinAttributes = root.joinMap(BuildRecord_.attributes.getName());
return query.where(cb.and(cb.equal(mapJoinAttributes.key(), key), cb.equal(mapJoinAttributes.value(), value))).getRestriction();
};
}
代码示例来源:origin: org.keycloak/keycloak-model-jpa
predicates.add(root.join("scopes").get("id").in(value));
} else if (name.startsWith("config:")) {
predicates.add(root.joinMap("config").key().in(name.substring("config:".length())));
predicates.add(builder.like(root.joinMap("config").value().as(String.class), "%" + value[0] + "%"));
} else {
predicates.add(builder.like(builder.lower(root.get(name)), "%" + value[0].toLowerCase() + "%"));
代码示例来源:origin: JoleneOL/market-manage
MapJoin<StockShiftUnit, Product, ProductBatch> amountJoin = root.joinMap("amounts");
amountJoin = amountJoin.on(cb.equal(amountJoin.key(), product));
代码示例来源:origin: JoleneOL/market-manage
@Override
public Specification<StockShiftUnit> specification() {
return (root, query, cb) -> {
final Join<StockShiftUnit, Depot> stockShiftUnitDepotJoin = StockShiftUnit.destinationJoin(root);
Predicate predicate = cb.and(
stockShiftUnitDepotJoin.isNotNull(),
StockShiftUnit.originJoin(root).isNull()
);
if (!StringUtils.isEmpty(mobile))
predicate = cb.and(predicate, cb.like(Depot.mobile(stockShiftUnitDepotJoin)
, "%" + mobile + "%"));
if (depotId != null)
predicate = cb.and(predicate, cb.equal(stockShiftUnitDepotJoin.get("id"), depotId));
// productCode 包含这个商品
if (!StringUtils.isEmpty(productCode)) {
MapJoin<StockShiftUnit, Product, ProductBatch> amountJoin = root.joinMap("amounts");
predicate = cb.and(predicate, cb.equal(amountJoin.key().get("code"), productCode));
}
if (orderDate != null) {
predicate = cb.and(
predicate
, JpaFunctionUtils.dateEqual(cb, StockShiftUnit.createDate(root), orderDate));
}
return predicate;
};
}
};
内容来源于网络,如有侵权,请联系作者删除!