New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Associations multiple join conditions bug #85
Comments
Thanks for the report! Unfortunately, I cannot reproduce the problem. Would it be possible for you to restore the constellation seen in the screenshot and press the "Reload Rows" button in the "MTL_ITEM_CATEGORIES" window? (The green arrow to the right of the "Where" input field). This logs the reload SQL statements into the "sql.log" file in the jailer directory. It would be very helpful for me to be able to view this log. |
Attached the log It's interesting to see that there are also errors: Thanks for looking into this! |
Thanks for the log file! A first impression:
which results in 585 rows. |
The ORA-31603 messages are harmless. An attempt is made to generate the DDL for the tables to be displayed in the metadata view. This obviously does not work for synonyms. |
interesting.. I think it should have also taken The join statement: |
However I get the idea that what is going on is that the association sets up the JOIN, but doesn't carry over the WHERE? I had hoped/expected that clicking on Related Rows, would carry over all the Association keys/filters set (as seen in the screenshot) |
Yes, the association-condition is part of the JOIN. |
Yes, it still contains different ORGANIZATION_IDs. The actual count (as the SQL screenshot shows) should be 13 rows when applying both the INVENTORY_ITEM_ID and ORGANIZATION_ID filters. Funny that the SQL Console got it right straight away (right click on MTL_ITEM_CATEGORIES and selecting SQL Console) while the Desktop tab doesn't |
I think I now know what is going wrong here. As you can see in the generated statement, only this key is used to establish the connection with the MTL_ITEM_CATEGORIES table. Not however any filters. This makes no difference as long as the key is unique. So be careful when defining keys manually. Keys must be unique, otherwise there will be problems in other places (e.g. subsetting). That's why there is this check tool. Since you are working with Oracle, you do not necessarily need a key for each table for the browser, since ROWID can be used here. |
While working on analysing the tables, indeed no primary keys were found in most tables and i've set them manually, INVENTORY_ITEM_ID is unique in this table, but not set as primary key in the DB (set as constraint). So you are saying it is not possible to have multiple associations work except if the primary key(s) are those associations? |
I meant that if you manually set a column or columns as "Primary Key" in the data model editor, then this key must be unique. What does this query return: |
Aaah, I'm sorry, I misunderstood as I was still thinking about the associations and the joins with the filters. I've now set the primary key in Jailer on the and you are correct that Didn't know I could set multiple Primary Keys on a table! So doing that now, it works :) Thanks for your help! |
Description of the Issue
When using Jailer 12.2 Data Browser and setting up an Association with multiple Join conditions, in the Desktop tab
the multiple conditions are ignored, while the SQL Console applies the multiple conditions.
Steps to Reproduce the Issue
Using Oracle:
Setup table: MTL_SYSTEM_ITEMS_B
Setup table: MTL_ITEM_CATEGORIES
Create Association:
From A: MTL_SYSTEM_ITEMS_B
Type: associates
To B: MTL_ITEM_CATEGORIES
Join condition: A.INVENTORY_ITEM_ID = B.INVENTORY_ITEM_ID AND A.ORGANIZATION_ID = B.ORGANIZATION_ID
Cardinality: 1:n
Name: msi-mic
Expected Behavior
In the Desktop tab, I expected the same to happen as on the SQL Console: show only 13 records.
Actual Behavior
The Desktop tab shows 500+ records because the AND A.ORGANIZATION_ID = B.ORGANIZATION_ID is ignored
it however does show the full condition when hovering over the 'on'
Debug Information
macOS: 12.2
Jailer 12.2
Thank you for creating and maintaining this wonderful tool!
The text was updated successfully, but these errors were encountered: