本文整理汇总了Java中javax.persistence.criteria.MapJoin类的典型用法代码示例。如果您正苦于以下问题:Java MapJoin类的具体用法?Java MapJoin怎么用?Java MapJoin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapJoin类属于javax.persistence.criteria包,在下文中一共展示了MapJoin类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildPropertyRestriction
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
private Predicate buildPropertyRestriction(
MapJoin<PersistentTemplate, String, String> propertiesMap,
Map<String, String> someProperties) {
Path<?> keyPath = propertiesMap.key();
Path<?> valuePath = propertiesMap.value();
List<Predicate> keyValuePairs = new LinkedList<Predicate>();
for (Map.Entry<String, String> entry : someProperties.entrySet()) {
Predicate keyPredicate = criteriaBuilder.equal(keyPath,
entry.getKey());
Predicate valuePredicate = criteriaBuilder.equal(valuePath,
entry.getValue());
Predicate keyValuePair = criteriaBuilder.and(keyPredicate,
valuePredicate);
keyValuePairs.add(keyValuePair);
}
return criteriaBuilder.or(keyValuePairs
.toArray(new Predicate[keyValuePairs.size()]));
}
开发者ID:wte4j,项目名称:wte4j,代码行数:19,代码来源:WordTemplateQuery.java
示例2: mapToMapPredicate
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Predicate mapToMapPredicate(final ComparisonNode node, final Path<Object> fieldPath,
final A enumField) {
if (!enumField.isMap()) {
return null;
}
final String[] graph = node.getSelector().split("\\" + FieldNameProvider.SUB_ATTRIBUTE_SEPERATOR);
final String keyValue = graph[graph.length - 1];
if (fieldPath instanceof MapJoin) {
// Currently we support only string key .So below cast is safe.
return cb.equal(cb.upper((Expression<String>) (((MapJoin<?, ?, ?>) fieldPath).key())),
keyValue.toUpperCase());
}
return cb.equal(cb.upper(fieldPath.get(enumField.getKeyFieldName())), keyValue.toUpperCase());
}
开发者ID:eclipse,项目名称:hawkbit,代码行数:17,代码来源:RSQLUtility.java
示例3: joinMapValue
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@Override
public Expression<?> joinMapValue(Expression<?> currentCriteriaPath, MetaAttribute pathElement, Object key) {
MapJoin<Object, Object, Object> mapJoin = ((From<?, ?>) currentCriteriaPath).joinMap(pathElement.getName(),
JoinType.LEFT);
Predicate mapJoinCondition = cb.equal(mapJoin.key(), key);
Predicate nullCondition = cb.isNull(mapJoin.key());
addPredicate(cb.or(mapJoinCondition, nullCondition));
return mapJoin;
}
开发者ID:katharsis-project,项目名称:katharsis-framework,代码行数:10,代码来源:JpaCriteriaQueryBackend.java
示例4: findMapJoin
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
public List<Object> findMapJoin() {
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Object> c = cb.createQuery();
Root<Employee> emp = c.from(Employee.class);
EntityType<Employee> emp_ = emp.getModel();
MapJoin<Employee, String, Phone> phone = emp.join(emp_.getMap("phones", String.class, Phone.class));
c.multiselect(emp.get(emp_.getSingularAttribute("name", String.class)), phone.key(), phone.value());
return em.createQuery(c).getResultList();
}
开发者ID:przodownikR1,项目名称:springJpaKata,代码行数:11,代码来源:SampleRepo.java
示例5: hasProperties
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
public WordTemplateQuery hasProperties(Map<String, String> someProperties) {
Subquery<Long> subQuery = query.subquery(Long.class);
Root<PersistentTemplate> fromSubQuery = subQuery
.from(PersistentTemplate.class);
Path<Long> id = fromSubQuery.get("id");
subQuery.select(id);
MapJoin<PersistentTemplate, String, String> propertiesMap = fromSubQuery
.joinMap("properties", JoinType.INNER);
subQuery.where(buildPropertyRestriction(propertiesMap, someProperties));
subQuery.groupBy(id);
subQuery.having(criteriaBuilder.equal(criteriaBuilder.count(id),
someProperties.size()));
restrictions.add(persistentTemplate.get("id").in(subQuery));
return this;
}
开发者ID:wte4j,项目名称:wte4j,代码行数:16,代码来源:WordTemplateQuery.java
示例6: join
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@Override
public <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map) {
// TODO Auto-generated method stub
return null;
}
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:6,代码来源:MugglFrom.java
示例7: joinMap
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@Override
public <X, K, V> MapJoin<X, K, V> joinMap(String attributeName) {
// TODO Auto-generated method stub
return null;
}
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:6,代码来源:MugglFrom.java
示例8: treat
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@Override
public <X, K, T, V extends T> MapJoin<X, K, V> treat(MapJoin<X, K, T> join,
Class<V> type) {
// TODO Auto-generated method stub
return null;
}
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:7,代码来源:MugglCriteriaBuilder.java
示例9: treat
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <X, K, T, V extends T> MapJoin<X, K, V> treat(MapJoin<X, K, T> join, Class<V> type) {
// return ( (MapJoinImplementor) join ).treatAs( type );
throw new NotYetImplementedException( );
}
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:7,代码来源:CriteriaBuilderImpl.java
示例10: join
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@Override
public <K, V> MapJoin<T, K, V> join( MapAttribute<? super T, K, V> arg0 )
{
// TODO Auto-generated method stub
return null;
}
开发者ID:ltearno,项目名称:hexa.tools,代码行数:7,代码来源:RootImpl.java
示例11: joinMap
import javax.persistence.criteria.MapJoin; //导入依赖的package包/类
@Override
public <X, K, V> MapJoin<X, K, V> joinMap( String arg0 )
{
// TODO Auto-generated method stub
return null;
}
开发者ID:ltearno,项目名称:hexa.tools,代码行数:7,代码来源:RootImpl.java
注:本文中的javax.persistence.criteria.MapJoin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论