Revision 2728
Added by sgarg almost 19 years ago
PostgresqlAdapter.java | ||
---|---|---|
101 | 101 |
} |
102 | 102 |
|
103 | 103 |
/** |
104 |
* PostgreSQL's syntax for doing a left join |
|
105 |
* Add 'a.' in front of the fields for first table and |
|
106 |
* 'b.' in front of the fields for the second table |
|
107 |
* |
|
108 |
* @param selectFields fields that you want to be selected |
|
109 |
* @param tableA first table in the join |
|
110 |
* @param tableB second table in the join |
|
111 |
* @param joinCriteria the criteria based on which the join will be made |
|
112 |
* @param nonJoinCriteria all other criterias |
|
113 |
* @return return the string for teh select query |
|
114 |
*/ |
|
115 |
public String getLeftJoinQuery(String selectFields, String tableA, |
|
116 |
String tableB, String joinCriteria, String nonJoinCriteria){ |
|
117 |
|
|
118 |
return "SELECT " + selectFields + " FROM " + tableA + " a LEFT JOIN " |
|
119 |
+ tableB + " b ON " + joinCriteria + " WHERE (" |
|
120 |
+ nonJoinCriteria +")"; |
|
121 |
} |
|
122 |
|
|
123 |
/** |
|
104 | 124 |
* Return a hard code string to get xml_document list in timed replcation |
105 | 125 |
*/ |
106 | 126 |
public String getReplicationDocumentListSQL() |
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