Fixes issue 36678: Where clause can be customized by query generator subclass
authorAugusto Mauch <augusto.mauch@openbravo.com>
Wed, 30 Aug 2017 10:51:37 +0200
changeset 32249 a1b1641f33a8
parent 32248 03effec411c3
child 32250 8f2cfd334ef8
Fixes issue 36678: Where clause can be customized by query generator subclass

Classes that extend DataSetTableQueryGenerator can now customize the where clause by overwriting the customizeExtraProperties method. The customization is done by adding WhereClauseSimpleExpression to the DataSetTableQueryGeneratorExtraProperties passed as parameter.

Classes that extend DataSetTableQueryGenerator sometimes need to know the name of the table being exported in order to know how to transform its query. For instance, depending on the table being exported sometimes a clause to exclude the records defined for client 0.

Now that table name is passed as a parameter to transformWhereClause. It is an API change, but it does not have any consequences, I checked that no one else is invoking that method.

The way the WhereClauseSimpleExpression where iterated to build a where clause was wrong, as if there were more than one the query would be built without joining each where clause with an 'AND' keyword.
src-db/database/lib/dbsourcemanager.jar
Binary file src-db/database/lib/dbsourcemanager.jar has changed