private <Y> CollectionJoinImplementor<X, Y> constructJoin( CollectionAttribute<? super X, Y> collection, 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 = collection.getBindableJavaType(); return new CollectionAttributeJoin<X, Y>( criteriaBuilder(), attributeType, this, collection, jt ); }
private <Y> CollectionJoinImplementor<X, Y> constructJoin(CollectionAttribute<? super X, Y> collection, 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 = collection.getBindableJavaType(); return new CollectionAttributeJoin<X, Y>( criteriaBuilder(), attributeType, this, collection, jt ); }
private <Y> CollectionAttributeJoin<X, Y> constructJoin(CollectionAttribute<? super X, Y> collection, String alias, JoinType jt) { checkJoin(collection, jt); final Class<Y> attributeType = collection.getBindableJavaType(); CollectionAttributeJoin<X, Y> join = new CollectionAttributeJoin<X, Y>(criteriaBuilder, attributeType, this, collection, jt); join.setAlias(alias); return join; }
private <Y> CollectionAttributeJoin<X, Y> constructJoin(CollectionAttribute<? super X, Y> collection, String alias, JoinType jt) { checkJoin(collection, jt); final Class<Y> attributeType = collection.getBindableJavaType(); CollectionAttributeJoin<X, Y> join = new CollectionAttributeJoin<X, Y>(criteriaBuilder, attributeType, this, collection, jt); join.setAlias(alias); return join; }
/** * Correlates a join to a Collection-valued association or element * collection in the enclosing query to a join object of the subquery and * returns the subquery join object. * * @param parentCollection * join target of the containing query * @return subquery join */ public <X, Y> CollectionJoin<X, Y> correlate(CollectionJoin<X, Y> parentCollection){ this.correlatedJoins.add(parentCollection); return new CollectionJoinImpl(parentCollection.getParentPath(), metamodel.managedType(parentCollection.getModel().getBindableJavaType()), metamodel, parentCollection.getJavaType(), internalCorrelate((FromImpl) parentCollection), parentCollection.getModel(), parentCollection.getJoinType(), (FromImpl) parentCollection); }
public <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection, JoinType jt) { org.eclipse.persistence.expressions.Expression node; Class clazz = collection.getBindableJavaType(); CollectionJoin<X, Y> join = null; if (jt.equals(JoinType.INNER)) { node = this.currentNode.anyOf(collection.getName()); } else if (jt.equals(JoinType.RIGHT)) { throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED")); } else { node = this.currentNode.anyOfAllowingNone(collection.getName()); } if (collection.getElementType().getPersistenceType().equals(PersistenceType.BASIC)) { join = new BasicCollectionJoinImpl<X, Y>(this, this.metamodel, clazz, node, (Bindable) collection, jt); } else { join = new CollectionJoinImpl<X, Y>(this, metamodel.managedType(clazz), this.metamodel, clazz, node, (Bindable) collection, jt); } this.joins.add(join); ((FromImpl)join).isJoin = true; return join; }