posted 4 months ago
Hi guys.
I am learning Spring boot and I am having problem with persisting data to DB.
I am trying to create a simple blog, with post and category. Here are the models.
Post
Category
Then I created a command line runner as follows:
I am try to save two posts and the related category to db, but for some reason only one post and related category is persisting, the second post is not persisting at all.
Further, Here is the error I am getting:
I've been at it for 3 days now. Please help.