In this article I’ll tell about an upgrade of Liquibase to the version 3.2.0 and how it interferes with the Variations project because of its dependencies.
If we want to work with a relational database we need our entities which are stored in and loaded from the database. Entities are Java objects which will be mapped to a line in a relational database table.
In this post I’ll introduce the needed entities for the variations project.
As mentioned in the article series of the Variations project I’ll use Spring as the core business logic framework. For the persistence Layer I’ll introduce now Hibernate.
Hibernate provides a mapping between Java objects and relational database tables and vice versa. Let’s look how to do it.
Until this time I started the Variations project only from Eclipse. Some days ago I downloaded the whole code and compiled it in the command line and wanted to start the packaged jar file — however I couldn’t. The cause was a NoClassDefFoundError.
As mentioned in the previous article I’m going to write some words about dependency injection — with Spring. As stated before there exist a lot of good books and articles about DI and I will only tell my opinion of the usage of DI. And I’ll focus on DI with Spring. Eventually I’ll take a look at JSR-330.
As a little milestone in the “Variations” project I’ll introduce Spring as a configuration and dependency injection framework, inversion of control container and so on — after the big part Liquibase.
I will not give a full stack introduction to Spring. I suggest you to read a book in this topic, there are many good introductory and pro books about Spring on the market. If you want to have an application quickly up and running search between the guides on Spring (take a closer look at Spring Boot).
The integration with Spring is not a big thing. You only have to configure your data source, the Liquibase bean and that’s it. OK, this sounds simple but there are really some pitfalls if you’ve never done this.