Insert data to tables when I have relations

i have two table books and authors in table book i have author_id (relation 1:1)
i want to add the author and add the book with relation to author object by author_id.
i tried to save the author and then give its objectId to book.author_id and also i tried to give complete object to book,author_id but nothing seems to work.

see this topic Database Relationship