private String determineRole(MapAttribute<?,K,?> attribute) { return attribute.getDeclaringType().getJavaType().getName() + '.' + attribute.getName(); }
@Override @SuppressWarnings({ "unchecked" }) public <K, V, M extends Map<K, V>> Expression<M> get(MapAttribute<X, K, V> attribute) { if ( ! canBeDereferenced() ) { throw illegalDereference(); } PluralAttributePath path = (PluralAttributePath) resolveCachedAttributePath( attribute.getName() ); if ( path == null ) { path = new PluralAttributePath( criteriaBuilder(), this, attribute ); registerAttributePath( attribute.getName(), path ); } return path; }
@Override public String getName() { return attribute.getName() + "_key"; }
@Override public String getName() { return attribute.getName() + "_entry"; }
/** * {@inheritDoc} * */ @Override @SuppressWarnings("unchecked") public <K, V> MapJoinImpl<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt) { return (MapJoinImpl<X, K, V>) this.join(map.getName(), jt); }
/** * {@inheritDoc} * */ @Override public <K, V, M extends Map<K, V>> Expression<M> get(MapAttribute<? super X, K, V> map) { throw this.cannotDereference(map.getName()); }
/** * {@inheritDoc} * */ @Override @SuppressWarnings("unchecked") public <K, V> MapJoinImpl<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt) { return (MapJoinImpl<X, K, V>) this.join(map.getName(), jt); }
/** * {@inheritDoc} * */ @Override public <K, V, M extends Map<K, V>> Expression<M> get(MapAttribute<? super X, K, V> map) { throw this.cannotDereference(map.getName()); }
private String determineRole(MapAttribute<?,K,?> attribute) { return attribute.getDeclaringType().getJavaType().getName() + '.' + attribute.getName(); }
@Override @SuppressWarnings({"unchecked"}) public <K, V, M extends Map<K, V>> BlazeExpression<M> get(MapAttribute<X, K, V> attribute) { checkGet(attribute); PluralAttributePath<M> path = (PluralAttributePath<M>) getAttributePath(attribute.getName()); if (path == null) { path = new PluralAttributePath<M>(criteriaBuilder, this, (PluralAttribute<?, M, ?>) attribute); putAttributePath(attribute.getName(), path); } return path; }
/** * {@inheritDoc} * */ @Override public final <K, V, M extends Map<K, V>> MapExpression<M, K, V> get(MapAttribute<? super X, K, V> map) { return new MapExpression<M, K, V>(this.<Map<K, V>, V> getMapping(map.getName())); }
/** * Return the path corresponding to the referenced map-valued attribute. * * @param model * map-valued attribute * @return expression corresponding to the referenced attribute */ @Override public <K, V, M extends java.util.Map<K, V>> Expression<M> get(MapAttribute<X, K, V> map){ return new ExpressionImpl<M>(this.metamodel, ClassConstants.Map_Class ,this.currentNode.anyOf(map.getName())); }
/** * {@inheritDoc} * */ @Override public final <K, V, M extends Map<K, V>> MapExpression<M, K, V> get(MapAttribute<? super X, K, V> map) { return new MapExpression<M, K, V>(this.<Map<K, V>, V> getMapping(map.getName())); }
@Override @SuppressWarnings({"unchecked"}) public <K, V, M extends Map<K, V>> BlazeExpression<M> get(MapAttribute<X, K, V> attribute) { checkGet(attribute); PluralAttributePath<M> path = (PluralAttributePath<M>) getAttributePath(attribute.getName()); if (path == null) { path = new PluralAttributePath<M>(criteriaBuilder, this, (PluralAttribute<?, M, ?>) attribute); putAttributePath(attribute.getName(), path); } return path; }
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(); }; }
/** * Gets a new path that represents the given map-valued attribute from this path. */ public <K, V, M extends java.util.Map<K, V>> Expression<M> get(MapAttribute<X, K, V> map) { if (getType() != map.getDeclaringType()) { map = (MapAttribute)((ManagedType)getType()).getAttribute(map.getName()); } return new PathImpl<X,M>(this, (Members.MapAttributeImpl<? super X,K,V>)map, (Class<M>)map.getJavaType()); }
/** * Gets a new path that represents the given map-valued attribute from this path. */ public <K, V, M extends java.util.Map<K, V>> Expression<M> get(MapAttribute<X, K, V> map) { if (getType() != map.getDeclaringType()) { map = (MapAttribute)((ManagedType)getType()).getAttribute(map.getName()); } return new PathImpl<X,M>(this, (Members.MapAttributeImpl<? super X,K,V>)map, (Class<M>)map.getJavaType()); }
/** * Gets a new path that represents the given map-valued attribute from this path. */ public <K, V, M extends java.util.Map<K, V>> Expression<M> get(MapAttribute<X, K, V> map) { if (getType() != map.getDeclaringType()) { map = (MapAttribute)((ManagedType)getType()).getAttribute(map.getName()); } return new PathImpl<X,M>(this, (Members.MapAttributeImpl<? super X,K,V>)map, (Class<M>)map.getJavaType()); }
/** * Gets a new path that represents the given map-valued attribute from this path. */ public <K, V, M extends java.util.Map<K, V>> Expression<M> get(MapAttribute<X, K, V> map) { if (getType() != map.getDeclaringType()) { map = (MapAttribute)((ManagedType)getType()).getAttribute(map.getName()); } return new PathImpl<X,M>(this, (Members.MapAttributeImpl<? super X,K,V>)map, (Class<M>)map.getJavaType()); }