No announcement yet.
  • Filter
  • Time
Clear All
new posts

    field defined with tableName is included in where clause if present in criteria

    Hello, I just noticed this behaviour.
    I've got an operationBinding of type fetch, which does not define SQL templating, but that is there only to define the attribute 'outputs', ie:

            <operationBinding operationType="fetch" operationId="accWebFetchLockAccrediti"
    If it's called with a criteria which contains a field which actually is defined with tableName, ie:
            <field foreignKey="JPC_LISTINI.ID_REC" name="ID_LISTINI_FK" type="integer" tableName="JPC_SETTORI"></field>
    then the criteria for this field is actually used in the where clause (leading to an error, of course).

    Is this expected? I mean the fact that the presence of the field in the criteria is sufficient to include the field in the where clause even if there's no SQL templating involved.

    It's intended, since there are ways you could introduce a join without SQL templating, such as dsField.includeFrom or even dsRequest dynamic includes, so it's not necessarily a mistake.

    We're don't currently plan to add code to check that there's no way you could possible have introduced a join, since that would take significant work and need to be maintained over time as new ways of creating joins are introduced, and the error is pretty obvious as things stand.


      Thanks for the clarification. May I suggest a note in the documentation?