public <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list, JoinType jt) {
org.eclipse.persistence.expressions.Expression node;
Class clazz = list.getBindableJavaType();
ListJoin<X, Y> join = null;
if (jt.equals(JoinType.INNER)) {
node = this.currentNode.anyOf(list.getName());
} else if (jt.equals(JoinType.RIGHT)) {
throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED"));
} else {
node = this.currentNode.anyOfAllowingNone(list.getName());
}
if (list.getElementType().getPersistenceType().equals(PersistenceType.BASIC)) {
join = new BasicListJoinImpl<X, Y>(this, this.metamodel, clazz, node, (Bindable) list, jt);
} else {
join = new ListJoinImpl<X, Y>(this, metamodel.managedType(clazz), this.metamodel, clazz, node, (Bindable) list, jt);
}
this.joins.add(join);
((FromImpl)join).isJoin = true;
return join;
}