Spring boot and MVC annotation list
To inject object of spring component class
To inject object having same name or ambiguity of multiple spring components
Define controller for rest endpoints
Define controller for web routing
Define routing map and endpoints
Define GET method endpoint for getting resource
Define POST method endpoint for inserting new request
Define DELETE method endpoint for delete request
Define PUT method endpoint for update request
Define input request parameter on request.
Define input request parameter on request as query string to show on URL.
To handle exception. To route exception if raises to define class.
To display response while calling resource method.
Property or method to become part of spring container.
Class having beans method to make part of spring application.
Comnination of below 3 annotations. It is used to run spring boot applcation. It annotates on main method of application launcher class.
Allowing request came from different source.
To return response as output object from method
To get request object as input to method
Add class to spring container
Make class as service class for business logic
Make class as repository for database operations like DAO
Enable application based on web MVC architecture
Scan packages where actual class reside and tell to spring container
Enable controller to accept request from different origin
Its Lombok annotation means DTO have no argument constructor
Its Lombok annotation means DTO have argument constructor of all defined fields
Its Lombok annotation means DTO have argument constructor of all the types
Its Lombok annotation used to clean up the code automatically before execution
Its Lombok annotation means DTO have to string method.
Its Lombok annotation used to generated and equals and hashcode method.
This annotation is referred as value must be not null
This annotation is used to log message in Slf4j
Its Lombok annotation used to generated auto builder API for complex pojo class
Defined DTO or getter setter class.
Used to get value on method.
Used to set value on method.
Enable Slf4j logging in class.
Used to get property value from properties file.
This is used to defined scope by default scope is singleton you can define other scope as well
To fetch header value from request using map collection.
Return response on method which is set on this annotation parameter.
This annotation is used to provide properties file to spring environment that which should be follow.
It is spring MVC base annotation used to store data from object and pass to view (JSP page) through controller.
This annotation retrieve the existing attribute from the session. This annotation allows you to tell Spring which of your model attributes will also be copied to HttpSession before rendering the view.
If class name is different from database table name then database table name defined with this annotation.
Refer class with database table.
Refer field name with database table column name.
Refer key column on database table.
This annotation refers mapping with column of one table refers to one column of other table.
This annotation refers mapping with column of one table refers to many column of other table.
This annotation refers mapping with many of one table refers to many column of other table.
This annotation defines that actual physical mapping on the owning side.
This is important annotation of spring transaction manager used in database DML transactions. It is used to rollback transaction if runtime exception occur during DML operations.
Its JPA annotation used in service or repository class where we want to perform database manipulation operation.
It is used in id field of class to map with table id field. It has parameter of strategy of how id is generated on every request.
It is used to make method synchronized (Thread safe) just like synchronized keyword in java. It also exists on class and method level.
It is only existed on method level to call that method asynchronously. When calling method on async mode sperate thread is open that will not affect main thread.
This annotation is used to specify a list of roles on a method. So, a user only can access that method if she has at least one of the specified roles.
This is similar @Secured annotation where we passed defined role on method.
The annotation can check for authorization before entering method. This authorizes on the basis of role or the argument which is passed to the method
This annotation checks for authorization after method execution. This authorizes based on logged in roles, return object by method and passed argument to the method
This annotation works in a very similar fashion; however, the filtering is applied to a list that is being passed as an input parameter to the annotated method.
This annotation defines a rule for filtering the return list of a method, by applying that rule to every element in the list. If the evaluated value is true, the item will be kept in the list. Otherwise, the item will be removed.
This annotation is primary to create unit and integration tests in Spring Boot applications.
This annotation used in method to test that method where it is used.
This annotation is used in Aspect-Oriented Programming to achieve the cross-cutting. It is an advice type which ensures that an advice runs before the method execution.
This annotation is used in Aspect-Oriented Programming to achieve the cross-cutting. It is an advice type which ensures that an advice runs after the method execution.
This annotation takes parameter as class name provides a bridge between Spring Boot test features and JUnit. Whenever we are using any Spring Boot testing features in our JUnit tests, this annotation will be required.
This annotation is a useful aid for writing unit tests of components in a Spring Boot application. It allows us to define additional beans or override existing beans in the Spring application context to add specialized configurations for testing.
This annotation to fire up an application context that contains only the beans needed for testing a web controller:
This is a class-level annotation that configures locations of property files and inclined properties in Spring integration test. The properties loaded by using this annotation are added to the set of @PropertySource in the Environment for an Application Context. The properties loaded by this annotation have higher precedence over the properties loaded from Java system properties