Everit Liquibase modules on maven-central

Recently, I decided to leave JPA and try something new concerning persistence. I evaluated many technologies and found Liquibase and QueryDSL to be the best for our needs. Both of them have their unique advantages.

Liquibase is perfect for maintaining database schemas. It is also possible to follow version changes when a deployment is performed and also to generate upgrade SQL scripts.

QueryDSL could work as a replacement of JPA Criteria API for us. JPA helped us to start a completely new way of programming. We could place our entities into separate modules and write utility functions that generate only a snippet from the complete SQL statement. However, we reached the limitations of JPA Criteria API soon. After I started to use QueryDSL, I felt that I superseded those limitations.

To use these technologies, we needed new tools and modules. We decided to use OSGi as the base of our framework, therefore, all our technologies must be modularized. By modularization, I do not only mean to extend the MANIFEST.MF file of the JAR files, but also to extend the functionality of our technologies to make it possible to use them within the concept of modularization. The following tools were implemented recently:

  • liquibase-bundle: I extended the functionality of Liquibase to be able to import database schema snippets from different bundles. The snippets can be imported transitively. I also enhanced the standard OSGi support of Liquibase a little bit. With the change, extensions can be deployed as fragment bundles. I would like to contribute to the Liquibase project with the code so that I do not have to maintain the changes.
  • liquibase-component: A simple OSGi Declarative Services component that uses the functionality of Liquibase-bundle to process changelog files. The component can be configured. One option is to upgrade the database, the other one is to dump the changes to SQL scripts so the db admin can perform the upgrade later. I am not sure if this component will have many future versions. It might happen that the code of the component will be integrated into the liquibase-datasource.
  • liquibase-datasource: A configurable DataSource component. It needs a DataSource to access the database and also a database schema expression that points to the liquibase changelog file. After the database migration is finished, the component registers a new DataSource OSGi service.
  • osgi-lqmg: Liquibase-QueryDSL-Metadata-Generator can be used to generate QueryDSL metadata classes directly from Liquibase changelog files. This tool uses the OSGi concept too, so instead of specifying the exact location of the changelog file, a Bundle-Capability must be defined.
  • lqmg-maven-plugin: A maven plugin that uses osgi-lqmg to generate Liquibase Metadata classes. The plugin deploys the dependencies into an embedded OSGi container and uses them to find the Liquibase changelogs.

With the tools above, it is possible to use Liquibase and QueryDSL together easily within the OSGi world. I hope that this will become a common solution in the future.

Advertisements

Tags: , , , ,

About Balázs Zsoldos

Balazs Zsoldos is the co-founder of Everit. He is the leader of the development of Everit OpenSource Components. Developing Java based solutions is not only his job but also his passion. He believes in simplicity. That is why he decided to design and build as many simple, but useful goal-oriented modules as he can. As the base of the stack, he chose OSGi. Balazs does not believe in monoholitic frameworks, therefore all of the solutions that was designed by him can be used separately. In the beginning of his career, Balazs was a big fan of JEE and Spring. After a while, he changed his mind and started to try replacing everything with non-magical solutions that do not contain interceptors, weaving, etc.

One response to “Everit Liquibase modules on maven-central”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: