Methods Summary |
---|
public boolean | addCondition(java.lang.String condition)
return addCondition(conditions, condition);
|
public void | addCondition(java.lang.String alias, java.lang.String[] columns, java.lang.String condition)
for ( int i=0; i<columns.length; i++ ) {
conditions.append(" and ")
.append(alias)
.append('.")
.append( columns[i] )
.append(condition);
}
|
public void | addCondition(java.lang.String alias, java.lang.String[] fkColumns, java.lang.String[] pkColumns)
throw new UnsupportedOperationException();
|
public void | addCrossJoin(java.lang.String tableName, java.lang.String alias)
buffer.append(", ")
.append(tableName)
.append(' ")
.append(alias);
|
public void | addFromFragmentString(java.lang.String fromFragmentString)
buffer.append(fromFragmentString);
|
public void | addJoin(java.lang.String tableName, java.lang.String alias, java.lang.String[] fkColumns, java.lang.String[] pkColumns, int joinType)
addJoin(tableName, alias, fkColumns, pkColumns, joinType, null);
|
public void | addJoin(java.lang.String tableName, java.lang.String alias, java.lang.String[] fkColumns, java.lang.String[] pkColumns, int joinType, java.lang.String on)
String joinString;
switch (joinType) {
case INNER_JOIN:
joinString = " inner join ";
break;
case LEFT_OUTER_JOIN:
joinString = " left outer join ";
break;
case RIGHT_OUTER_JOIN:
joinString = " right outer join ";
break;
case FULL_JOIN:
joinString = " full outer join ";
break;
default:
throw new AssertionFailure("undefined join type");
}
buffer.append(joinString)
.append(tableName)
.append(' ")
.append(alias)
.append(" on ");
for ( int j=0; j<fkColumns.length; j++) {
/*if ( fkColumns[j].indexOf('.')<1 ) {
throw new AssertionFailure("missing alias");
}*/
buffer.append( fkColumns[j] )
.append('=")
.append(alias)
.append('.")
.append( pkColumns[j] );
if ( j<fkColumns.length-1 ) buffer.append(" and ");
}
addCondition(buffer, on);
|
public void | addJoins(java.lang.String fromFragment, java.lang.String whereFragment)
buffer.append(fromFragment);
//where fragment must be empty!
|
public JoinFragment | copy()
ANSIJoinFragment copy = new ANSIJoinFragment();
copy.buffer = new StringBuffer( buffer.toString() );
return copy;
|
public java.lang.String | toFromFragmentString()
return buffer.toString();
|
public java.lang.String | toWhereFragmentString()
return conditions.toString();
|