Announcement

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

    Enhancement: BuiltInDS DataSource with foreignKey

    Hi Isomorphic,

    could you amend one of the BuiltInDS-sample DataSources with some foreignKeys?
    E.g., make gender a own DataSource or add an "owner" field (FK to employees) to animals, ...

    I need this in order to create a test case and failed doing it on my own. Also I think many user will benefit from it in general. I tried
    1. adding a field in isomorphic.script (does not work for me, some hsqldb exception)
    2. abusing animals.lifeSpan as FK to employees.EmployeeId (results in no rows in join)
    3. changing every animals.lifeSpan to number "227" in animals.data.xml (does not change the outcome, still no rows in result. "227" should be employee "Kaushik Shroff" according to employees.data.xml
    4. Firing an update to animals in isomorphic.script (does not work for me, some hsqldb exception)


    Is #3 supposed to work, are the *.data.xml used as data or does the DB data come from hsqldb binary file isomorphic.data?

    Best regards,
    Blama

    #2
    In addition,

    using just employees, which already has a FK, does not work, either:

    employees.ds.xml
    Code:
    <field name="ReportsTo"       title="Manager"         type="integer"  required="true" displayField="employeesName" 
           foreignKey="employees.EmployeeId" editorType="comboBoxItem" relatedTableName="employeeTableTwo" />
    <field name="employeesName"   includeFrom="employees.Name" hidden="true" />
    results in:
    Code:
    SELECT COUNT(*) FROM employeeTable WHERE ('1'='1') AND employeeTable.ReportsTo = employeeTable.EmployeeId
    Best regards,
    Blama

    Comment


      #3
      We don't plan to modify this test case to introduce foreignKeys. It is designed to be simple.

      HSQL DB uses the .data files. You can use the Admin Console to re-import the .data.xml file.

      Your changes to employees.ds.xml would not be expected to create a join, if that's what you meant to show.

      Comment


        #4
        Hi Isomorphic,

        that's what I wanted to show. I definitely got the relatedTableName wrong (it's relatedTableAlias).

        I found an easy way to create testcases with a FK using the technique from this thread (copying the employees.ds.xml and using the same table name in the 2nd file. "employees"-entries already have Foreign Key data), so this is fine for me.

        Best regards,
        Blama

        Comment


          #5
          This is solved, see this thread.

          Comment

          Working...
          X