@SpringBootApplication Annotation

@SpringBootApplication attribute is used to enable auto-configuration, component scan and to define extra configuration in a single application class. @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } Though the same things can be achieved using following annotations individually @EnableAutoConfiguration: enable Spring Boot’s auto-configuration mechanism automatically configure your Spring application based … More @SpringBootApplication Annotation

@ComponentScan vs @EntityScan

@ComponentScan is used for scanning all your components those are marked as @Controller, @Service, @Repository, @Component etc… where @EntityScan is used to scan all your Entities those are marked @Entity for any configured JPA in your application.   @ComponentScan: @Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Repeatable(value=ComponentScans.class) public @interface ComponentScan Configures component scanning directives for use with @Configuration classes. It … More @ComponentScan vs @EntityScan

@Inject vs. @Autowired

@Inject and @Autowired both annotations are used in Java and Spring do achieve Dependency Injection respectively. Please read our blog Dependency Injection for better understanding. @Inject is part of the Java CDI (Contexts and Dependency Injection) standard introduced in Java EE 6 (JSR-299). Basically, Classes typically acquire references to other Classes through dependency injection. The dependency … More @Inject vs. @Autowired