Deleting @ManyToMany parent entity without affecting child on Hibernate

Oh Dear!! It’s a nightmare getting MySQLIntegrityConstraintViolationException when you’re designing complex relational database structure for your app. Most of the time hibernate won’t complain with your approximation but this won’t work when it comes to bidirectional relations. Let me show an example. But first consider a scenario that we’re making a movie database application. We have two entities and…

Read More

How to deploy Spring boot app as .war file

Hello from ToraCode. If you find your cloud platform doesn’t support container service or deploying standalone application you may find it annoying deploying your app in the cloud. But you can still try creating a traditional .war file to deploy into a container like Tomcat 8, Wildfly 10 or other container. It’s very easy to deploy Spring boot app…

Read More

Deploying sample spring boot app using Docker

Hello from ToraCode. Now that we are set up with Docker virtualisation software. Let’s modify our pom.xml a little bit so that we can build our docker image. We have to add Docker Maven Plugin in our pom.xml file. Inside our <plugins> </plugins> tag we need to add this plugin.

Look a this code. For…

Read More