Announcement

Collapse
No announcement yet.
X
  • 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:

    Code:
            <operationBinding operationType="fetch" operationId="accWebFetchLockAccrediti"
                              outputs="ID_REC,ID_FILE_SETTORI_FK,NUMERO_POSTO,LOCK_ACCREDITI, ID_POSTO_ACCOMPAGNATORE_FK">
            </operationBinding>
    If it's called with a criteria which contains a field which actually is defined with tableName, ie:
    Code:
            <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.

    #2
    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.

    Comment


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

      Comment

      Working...
      X