Since the SessionId is generated by the database upon saving the session, you need to follow a two-step process to save both the Session and the associated SessionExplanations:
1- Save the session object to the database, which will generate and return the SessionId.
2- Once you have the SessionId, you can then save the SessionExplanations objects.
However, it is possible to streamline this process into a single API call. You can structure your API to accept a complete payload that includes the Session object and its related Explanation IDs. Then, handle both saving operations within a single transaction on the server side.