What is spring auto-configuration?

What is spring auto-configuration?

Spring Boot auto-configuration attempts to automatically configure your Spring application based on the jar dependencies that you have added. For example, If HSQLDB is on your classpath, and you have not manually configured any database connection beans, then we will auto-configure an in-memory database.

What is ConditionalOnClass?

Annotation Type ConditionalOnClass @Conditional that only matches when the specified classes are on the classpath. A value() can be safely specified on @Configuration classes as the annotation metadata is parsed by using ASM before the class is loaded.

Which annotation can be used to import additional configuration classes?

@Import annotation
The @Import annotation can be used to import additional configuration classes.

What is the difference between @SpringBootApplication and @EnableAutoConfiguration annotation?

@SpringBootApplication is a newer version of @EnableAutoConfiguration which was introduced in Spring Boot 1.2. @ComponentScan enables component scanning so that web controller classes and other components that you create will be automatically discovered and registered as beans in spring’s application context.

What is annotation @SpringBootApplication comprise of?

So, you can say that @SpringBootApplication is a 3-in-1 annotation that combines the functionality of @Configuration, @ComponentScan, and @EnableAutoConfiguration.

What is configuration class in Spring boot?

@Configuration annotation indicates that a class declares one or more @Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime. This is called Spring Java Config feature (using @Configuration annotation).

What is Dao class in Spring?

The Data Access Object (DAO) support in Spring is aimed at making it easy to work with data access technologies like JDBC, Hibernate, JPA or JDO in a consistent way.

What is @ConditionalOnBean in Spring boot?

Annotation Type ConditionalOnBean. @Conditional that only matches when beans meeting all the specified requirements are already contained in the BeanFactory . All the requirements must be met for the condition to match, but they do not have to be met by the same bean.

What is @import annotation in Spring boot?

@Import annotation in Spring allows you to load bean definitions from one or more another @Configuration files or Components. Using @Import we can split the configurations across multiple configuration files for modularising, that makes our code more cleaner and maintainable.

What is the use of ContextConfiguration?

@ContextConfiguration defines class-level metadata that is used to determine how to load and configure an ApplicationContext for integration tests.

What is @repository in Spring boot?

@Repository is a Spring annotation that indicates that the decorated class is a repository. A repository is a mechanism for encapsulating storage, retrieval, and search behavior which emulates a collection of objects.

What is a JavaBean class?

A JavaBean is a Java object that satisfies certain programming conventions: The JavaBean class must implement either Serializable or Externalizable. The JavaBean class must have a no-arg constructor. All JavaBean properties must have public setter and getter methods. All JavaBean instance variables should be private.

How to access the underlying properties of a JavaBean?

A JavaBean has accessor (getXxx, or isXxx for Boolean properties) methods and mutator methods (setXxx) that allow access to its underlying properties. The 3rd point states a java class with private instance variables and public getter, setter.

What are histocompatibility complex (MHC) proteins?

Major histocompatibility complex (MHC) class I and class II proteins play a pivotal role in the adaptive branch of the immune system. Both classes of proteins share the task of presenting peptides on the cell surface for recognition by T cells.

What is a java bean class?

According to Java white paper, it is a reusable software component. A bean encapsulates many objects into one object, so we can access this object from multiple places. Moreover, it provides the easy maintenance. To access the java bean class, we should use getter and setter methods.