Changeset View
Changeset View
Standalone View
Standalone View
src/KDbNativeStatementBuilder.cpp
Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Line(s) | 323 | foreach(KDbRelationship *rel, *querySchema->relationships()) { | |||
---|---|---|---|---|---|
337 | } | 337 | } | ||
338 | if (rel->fieldPairs()->count() > 1) { | 338 | if (rel->fieldPairs()->count() > 1) { | ||
339 | s_where_sub.prepend('('); | 339 | s_where_sub.prepend('('); | ||
340 | s_where_sub += ')'; | 340 | s_where_sub += ')'; | ||
341 | } | 341 | } | ||
342 | s_where += s_where_sub; | 342 | s_where += s_where_sub; | ||
343 | } | 343 | } | ||
344 | //EXPLICITLY SPECIFIED WHERE EXPRESSION | 344 | //EXPLICITLY SPECIFIED WHERE EXPRESSION | ||
345 | if (driver && !querySchema->whereExpression().isNull()) { | 345 | if (!querySchema->whereExpression().isNull()) { | ||
346 | KDbQuerySchemaParameterValueListIterator paramValuesIt(parameters); | 346 | KDbQuerySchemaParameterValueListIterator paramValuesIt(parameters); | ||
347 | KDbQuerySchemaParameterValueListIterator *paramValuesItPtr = parameters.isEmpty() ? 0 : ¶mValuesIt; | 347 | KDbQuerySchemaParameterValueListIterator *paramValuesItPtr = parameters.isEmpty() ? 0 : ¶mValuesIt; | ||
348 | if (wasWhere) { | 348 | if (wasWhere) { | ||
349 | //! @todo () are not always needed | 349 | //! @todo () are not always needed | ||
350 | s_where = '(' + s_where + ") AND (" | 350 | s_where = '(' + s_where + ") AND (" | ||
351 | + querySchema->whereExpression().toString(driver, paramValuesItPtr) + ')'; | 351 | + querySchema->whereExpression().toString(driver, paramValuesItPtr) + ')'; | ||
352 | } else { | 352 | } else { | ||
353 | s_where = querySchema->whereExpression().toString(driver, paramValuesItPtr); | 353 | s_where = querySchema->whereExpression().toString(driver, paramValuesItPtr); | ||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |