1 17 package org.apache.ws.jaxme.sqls.impl; 18 19 import org.apache.ws.jaxme.sqls.JoinReference; 20 import org.apache.ws.jaxme.sqls.SelectStatement; 21 import org.apache.ws.jaxme.sqls.SelectTableReference; 22 import org.apache.ws.jaxme.sqls.Table; 23 24 27 public class SelectTableReferenceImpl extends TableReferenceImpl implements SelectTableReference { 28 private JoinReference joinReference; 29 30 33 public SelectTableReferenceImpl(SelectStatement pStatement, Table pTable) { 34 super(pStatement, pTable); 35 } 36 37 public JoinReference join(Table pTable) { 38 if (joinReference != null) { 39 throw new IllegalStateException ("The table is already involved in a left join."); 40 } 41 joinReference = getStatement().getSQLFactory().getObjectFactory().newJoinReference(this, pTable, false); 42 return joinReference; 43 } 44 45 public JoinReference leftOuterJoin(Table pTable) { 46 if (joinReference != null) { 47 throw new IllegalStateException ("The table is already involved in a left join."); 48 } 49 joinReference = getStatement().getSQLFactory().getObjectFactory().newJoinReference(this, pTable, true); 50 return joinReference; 51 } 52 53 public SelectStatement getSelectStatement() { 54 return (SelectStatement) getStatement(); 55 } 56 57 public JoinReference getRightJoinedTableReference() { 58 return joinReference; 59 } 60 } 61 | Popular Tags |