@Condition Annotation

Spring @Condition Annotation

About this tutorial

The following guides illustrate how to use @Condition annotation in Spring boot application. Example: You have a User interface and method to get the list of database. You have two implementations of the interface one implementation connected to MySQL database and one connected to MongoDB.

Let's have a look at this in action.

Run this project

mvn spring-boot:run -DdbType=mysql/mongodb