Whenever you need, to perform a specific task once after all the Spring Beans are created and the Application Context has been created then you can implement ApplicationRunner or CommandLineRunner interface. Both the interfaces works the same way and has a single run() method. A similar implementation is already there in Spring and many people would have known it JobLauncherCommandLineRunner which is used for running jobs in Spring Batch. [Read more…]
Previously we have learnt how to build a Spring Boot Hello World application using Maven and through Eclipse. In this Spring Boot example we will be building the same hello world application with a slight difference instead of building a executable JAR we will be be building a WAR file. We will be extending SpringBootServletInitializer in order to create deployable WAR file. [Read more…]
If a database table has more than one column as the primary key then we call it as composite primary key. In this Hibernate Composite Primary Key tutorial, we will learn how to define Composite Primary Key using <composite-id> tag and Annotations. [Read more…]
In the previous Spring Boot Hello World example we build our application with Maven through command prompt. In this article, we will be building the same Spring Boot Hello World example using IDE. I will be using Spring Tool Suite(STS) for development, you can also use Eclipse along with m2eclipse plugin. [Read more…]
Spring Boot is developed as a subproject of spring framework in order to create a stand-alone application with minimum possible configuration. In this Spring Boot Hello World Example, we will build a simple hello world example using Spring boot with maven. [Read more…]
Table per Class Hierarchy strategy will be having a single table for both the Parent class and the Sub class separated by a discriminator column. In Table per Subclass Hierarchy, subclass table will be mapped to the Parent class table by primary key and foreign key relationship. In Table Per Concrete Class Hierarchy also individual table will be created for each class. The disadvantage of this approach is that all the columns of the Primary class table will be again replicated in the Subclass table.
Previously we have seen how to implement Spring Security in a Hello World program using XML configuration. In this Spring Security Annotation Configuration Example, we will be using the same example but instead of XML configuration, we will be configuring it through annotation.
In the previous example we have seen Table per Class Hierarchy strategy, there we will be having a single table for both the Parent class and the Sub class separated by a discriminator column. In this Table per Subclass Hierarchy Example, subclass table will be mapped to the Parent class table by primary key and foreign key relationship.
In this post, we will learn how to integrate AngularJS with Spring MVC and perform CRUD operation using $http service. We will be building a REST Web service using Spring MVC Controller (@RESTController) and AngularJS will act as the front-end, through $http service we will perform Create, Read, Update, Delete operations.