Announcement

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

    When to include the "foreignKey" attribute in ds.xml file?

    Hi Isomorphic,

    I have this structure in a RDBMS:

    person(id: int, honorific_id: int, givenname: varchar, name: varchar)
    honorific(id: int, shortdesc: varchar, longdesc: varchar), DB-level FK is set.

    Do you suggest / is it necessary to set the foreignKey-attribute in .ds.xml?

    From my reading of the javadocs it is necessary/helpful for:
    - Update of cached entries (eg. 2nd grid for editing "honorific"-data, display of new added data in "person"-honorific-Dropdown without reload).
    - DataBoundComponent: Drag and Drop.
    - DataBoundComponent: DropValues.

    NOT necessary/helpful in my example case, as:
    1) display of names instead of honorific_ids via fetch-operation binding with join and different displayField="..." in ds.xml for the honorific_id
    2) display of editor-Dropdown (ComboBoxItem) with optionDataSource in java file
    3) display of filter-Dropdown (SelectItem) with optionDataSource in java file.

    Could you advise if this is correct / add other cases? Or is it in general a good idea to include DB-level FKs in .ds.xml files as well?

    Thank you,
    Blama
Working...
X