private <Y> SetJoinImplementor<X, Y> constructJoin(SetAttribute<? super X, Y> set, JoinType jt) { if ( jt.equals( JoinType.RIGHT ) ) { throw new UnsupportedOperationException( "RIGHT JOIN not supported" ); } // TODO : runtime check that the attribute in fact belongs to this From's model/bindable final Class<Y> attributeType = set.getBindableJavaType(); return new SetAttributeJoin<X, Y>( criteriaBuilder(), attributeType, this, set, jt ); }
private <Y> SetJoinImplementor<X, Y> constructJoin(SetAttribute<? super X, Y> set, JoinType jt) { if ( jt.equals( JoinType.RIGHT ) ) { throw new UnsupportedOperationException( "RIGHT JOIN not supported" ); } // TODO : runtime check that the attribute in fact belongs to this From's model/bindable final Class<Y> attributeType = set.getBindableJavaType(); return new SetAttributeJoin<X,Y>( criteriaBuilder(), attributeType, this, set, jt ); }
private <Y> SetAttributeJoin<X, Y> constructJoin(SetAttribute<? super X, Y> set, String alias, JoinType jt) { checkJoin(set, jt); final Class<Y> attributeType = set.getBindableJavaType(); SetAttributeJoin<X, Y> join = new SetAttributeJoin<X, Y>(criteriaBuilder, attributeType, this, set, jt); join.setAlias(alias); return join; }
private <Y> SetAttributeJoin<X, Y> constructJoin(SetAttribute<? super X, Y> set, String alias, JoinType jt) { checkJoin(set, jt); final Class<Y> attributeType = set.getBindableJavaType(); SetAttributeJoin<X, Y> join = new SetAttributeJoin<X, Y>(criteriaBuilder, attributeType, this, set, jt); join.setAlias(alias); return join; }
/** * Correlates a join to a Set-valued association or element collection in * the enclosing query to a join object of the subquery and returns the * subquery join object. * * @param parentSet * join target of the containing query * @return subquery join */ public <X, Y> SetJoin<X, Y> correlate(SetJoin<X, Y> parentCollection){ this.correlatedJoins.add(parentCollection); return new SetJoinImpl(parentCollection.getParentPath(), metamodel.managedType(parentCollection.getModel().getBindableJavaType()), metamodel, parentCollection.getJavaType(), ((InternalSelection)parentCollection).getCurrentNode(), parentCollection.getModel(), parentCollection.getJoinType(), (FromImpl) parentCollection); }
public <Y> SetJoin<X, Y> join(javax.persistence.metamodel.SetAttribute<? super X, Y> set, JoinType jt) { org.eclipse.persistence.expressions.Expression node; Class clazz = set.getBindableJavaType(); SetJoin<X, Y> join = null; if (jt.equals(JoinType.INNER)) { node = this.currentNode.anyOf(set.getName()); } else if (jt.equals(JoinType.RIGHT)) { throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED")); } else { node = this.currentNode.anyOfAllowingNone(set.getName()); } if (set.getElementType().getPersistenceType().equals(PersistenceType.BASIC)) { join = new BasicSetJoinImpl<X, Y>(this, this.metamodel, clazz, node, (Bindable) set, jt); } else { join = new SetJoinImpl<X, Y>(this, metamodel.managedType(clazz), this.metamodel, clazz, node, (Bindable) set, jt); } this.joins.add(join); ((FromImpl)join).isJoin = true; return join; }