Revision 2728
Added by sgarg over 18 years ago
OracleAdapter.java | ||
---|---|---|
98 | 98 |
|
99 | 99 |
return "'"; |
100 | 100 |
} |
101 |
|
|
102 |
/** |
|
103 |
* The Oracles's syntax for doing a left join |
|
104 |
* Add 'a.' in front of the fields for first table and |
|
105 |
* 'b.' in front of the fields for the second table |
|
106 |
* |
|
107 |
* @param selectFields fields that you want to be selected |
|
108 |
* @param tableA first table in the join |
|
109 |
* @param tableB second table in the join |
|
110 |
* @param joinCriteria the criteria based on which the join will be made |
|
111 |
* @param nonJoinCriteria all other criterias |
|
112 |
* @return return the string for teh select query |
|
113 |
*/ |
|
114 |
public String getLeftJoinQuery(String selectFields, String tableA, |
|
115 |
String tableB, String joinCriteria, String nonJoinCriteria){ |
|
116 |
|
|
117 |
return "SELECT " + selectFields + " FROM " + tableA + " a, " |
|
118 |
+ tableB + " b WHERE " + joinCriteria + "(+) " + " AND (" |
|
119 |
+ nonJoinCriteria +")"; |
|
120 |
} |
|
101 | 121 |
|
102 | 122 |
|
103 | 123 |
/** |
Also available in: Unified diff
New function which returns the formatted left join query. This is required as Oracle and postgres have different left join syntax