Purab’s IntelliJ IDEA File and Code Templates for Productive SpringBoot development

For devlopment I am using Intellij IDE. I found “File and Code Templates” and “Live Templates” very useful, It is beneficial while doing day-to-day development. It saves some time and be more productive. github link: https://github.com/purab/IntelliJ-IDEA-File-Templates Mostly we work on Rest APIs. So I created the following File Templates Spring ControllerSpring EntitySpring RepositorySpring ServiceSpring Static …

Solved Error executing DDL “alter table events drop foreign key

While running spring boot application I got following error 2021-10-22 13:38:59.732  WARN 700 — [ restartedMain] o.h.t.s.i.ExceptionHandlerLoggedImpl  : GenerationTarget encountered exception accepting command : Error executing DDL “alter table users_roles add constraint FKt4v0rrweyk393bdgt107vdx0x foreign key (role_id) references role (id)” via JDBC Statement org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL “alter table users_roles add constraint FKt4v0rrweyk393bdgt107vdx0x foreign …

Spring and Gradle – adding to the project WebJars Bootstrap

If you wanted to add bootstrap UI CSS and JS files in thymeleaf then you can use following code: <link th:href=”@{/webjars/bootstrap/5.0.0/css/bootstrap.min.css}” rel=”stylesheet” media=”screen” /><script th:src=”@{/webjars/bootstrap/5.0.0/js/bootstrap.min.js}”></script> If those styles are still not loading then refresh project and if you are using spring security then you need to add following code in your extended class of WebSecurityConfigurerAdapter …