- I have three tables, DISTRIBUTION_LIST, USERS, and ADDRESSES.
- Single object 'distribution_list' has multiple users and addresses.
- I want to create transaction which will write to those three table together and FOREIGN_KEY in tables USERS and ADDRESSES is PRIMARY_KEY from DISTRIBUTION_LIST which is AUTO INCREMENT.
Actually I have described my problem already, how to know PRIMARY_KEY from DISTRIBUTION_LIST when I create statement to insert data into USERS and ADDRESSES? One solution to calculate PRIMARY_KEY manually, but possible there's more elegant solution for this task?