/adgadev/

Developer is an organism that turns coffee into code.

Extending and customizing auto-configuration classes provided by Spring Boot

How to dynamically exclude selected Spring Boot auto-configuration classes using profile groups

Problem statement Imagine a scenario when we need to enable certain spring boot auto-configuration on a subset of environments only. The reason for that may be that i.e. our new feature will use new database (mongo) which hasn’t been setup on all environments yet for some reason, but we don’t want this issue to stop us from deploying new version of the application. Not all spring boot auto-configurations support disabling them using property.

Finding origin and context of JPA issued SQL statements

Automatic correlating executed SQL statements with exact places in code responsible for triggering them and with detailed use case context, in JPA based applications using JPlusOne library

What problem are we solving here? ORM frameworks like Hibernate and other JPA implementors can significantly simplify development of persistence layer. Introducing entity abstraction level helps to model clean business domain and to hide underlying SQL statements used to achieve persistence of the domain. Such approach is especially useful in large domains, since developer no longer needs to create and maintain all SQL statements used by application. Just a few JPA annotations like @Entity / @ManyToOne / @OneToMany etc.