* Initialize the expression builder which should be used for this query. If
* there is a where clause, use its expression builder, otherwise
* generate one and cache it. This helps avoid unnecessary rebuilds.
*/
protected void initializeDefaultBuilder() {
DatabaseQueryMechanism mech = getQueryMechanism();
if (mech.isExpressionQueryMechanism() && ((ExpressionQueryMechanism)mech).getExpressionBuilder() != null) {
this.defaultBuilder = ((ExpressionQueryMechanism)mech).getExpressionBuilder();
if (this.defaultBuilder.getQueryClass() != null && !this.defaultBuilder.getQueryClass().equals(this.referenceClass)){
this.defaultBuilder = new ExpressionBuilder();
}
return;