use of org.eclipse.persistence.internal.expressions.ObjectExpression in project eclipselink by eclipse-ee4j.
the class FromImpl method join.
@Override
public <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute, JoinType jt) {
if (((SingularAttribute) attribute).getType().getPersistenceType().equals(PersistenceType.BASIC)) {
throw new IllegalStateException(ExceptionLocalization.buildMessage("CAN_NOT_JOIN_TO_BASIC"));
}
Class<Y> clazz = attribute.getBindableJavaType();
Join<X, Y> join = null;
ObjectExpression exp = ((ObjectExpression) this.currentNode).newDerivedExpressionNamed(attribute.getName());
if (jt.equals(JoinType.LEFT)) {
exp.doUseOuterJoin();
} else if (jt.equals(JoinType.RIGHT)) {
throw new UnsupportedOperationException(ExceptionLocalization.buildMessage("RIGHT_JOIN_NOT_SUPPORTED"));
} else {
exp.doNotUseOuterJoin();
}
join = new JoinImpl<X, Y>(this, this.metamodel.managedType(clazz), this.metamodel, clazz, exp, attribute, jt);
this.joins.add(join);
((FromImpl) join).isJoin = true;
return join;
}
Aggregations