Month: August 2020
-
How to use Window functions in SQL?
SQL has evolved a lot since its widely adopted standard SQL-92. Most of the queries which developers use belong to this standard. It represents the relational database model. Markus Winand of modern-sql.com says SQL has grown five times since that standard and SQL is not just a relational database model anymore. You can store JSON…
-
What are the different ways to delete a child entity in JPA/hibernate through Spring Data?
Let’s say you have an application which creates blog posts and saves them and also the comments user enter on the posts. The Blogpost and the comment represent a parent and child relationship. You may want to delete the comments in three different ways: Delete the comment whenever the blogpost is deleted. Delete the comment…
-
How to save both parent and child records on saving parent record in JPA/hibernate?
Let’s say you have created an application to post blogs. You are allowing users to comment on the blogs. Every blog is associated with many comments. You have chosen spring data as your backend technology. How would you design this ? You can create an entity class representing a blog post , say Blogpost.java And…