1 17 package org.apache.ws.jaxme.sqls.impl; 18 19 import org.apache.ws.jaxme.sqls.CombinedConstraint; 20 import org.apache.ws.jaxme.sqls.JoinReference; 21 import org.apache.ws.jaxme.sqls.ObjectFactory; 22 import org.apache.ws.jaxme.sqls.SelectTableReference; 23 import org.apache.ws.jaxme.sqls.Table; 24 25 26 29 public class JoinReferenceImpl extends SelectTableReferenceImpl implements JoinReference { 30 private boolean outerJoin; 31 private SelectTableReference leftTableReference; 32 private CombinedConstraint onClause; 33 34 36 protected JoinReferenceImpl(SelectTableReference pLeftTableReference, Table pRightTable, 37 boolean pOuterJoin) { 38 super(pLeftTableReference.getSelectStatement(), pRightTable); 39 leftTableReference = pLeftTableReference; 40 outerJoin = pOuterJoin; 41 } 42 43 public boolean isJoin() { 44 return !outerJoin; 45 } 46 47 public boolean isLeftOuterJoin() { 48 return outerJoin; 49 } 50 51 public SelectTableReference getLeftJoinedTableReference() { 52 return leftTableReference; 53 } 54 55 public CombinedConstraint getOn() { 56 if (onClause == null) { 57 ObjectFactory f = getSelectStatement().getSQLFactory().getObjectFactory(); 58 onClause = f.newCombinedConstraint(getSelectStatement(), CombinedConstraint.Type.AND); 59 } 60 return onClause; 61 } 62 } 63 | Popular Tags |