Posts

Showing posts with the label Liquibase

Liquibase Tutorial

What is Liquibase ? LiquiBase — available since 2006 — is an open source, freely available tool for migrating from one database version to another, It is an open source database-independent library for tracking, managing and applying database changes. A handful of other open source database-migration tools are on the scene as well, including openDBcopy and dbdeploy. LiquiBase supports 10 database types, including DB2, Apache Derby, MySQL, PostgreSQL, Oracle, Microsoft® SQL Server, Sybase, and HSQL. All changes to the database are stored in XML files and identified by a combination of an "id" and "author" tag as well as the name of the file itself. A list of all applied changes is stored in each database which is consulted on all database updates to determine what new changes need to be applied. LiquiBase executes changes based on this XML file to handle different revisions of database structures and data. When you first ...

What is Liquibase ?

1.  Liquibase is an open source database-independent library for tracking, managing and applying database changes. 2. All changes to the database are stored in XML files and identified by a combination of an "id" and "author" tag as well as the name of the file itself. 3. A list of all applied changes is stored in each database which is consulted on all database updates to determine what new changes need to be applied. 4. Liquibase executes changes based on this XML file to handle different revisions of database structures and data. 5. When you first run a changelog, LiquiBase manages those changelogs by adding two tables into your database. databasechangelog : maintains the database changes that were run. databasechangeloglock : ensures that two machines don't attempt to modify the database at one time. 6. Limitations do exist such that it will not export triggers, stored procedures, functions and packages. Sample changeLog file:  The above is...

How to integrate Liquibase with Spring and Hibernate ?

Image
A sample tutorial on how to integrate Liquibase with Spring and Hibernate. While writing this tutorial, I have added javadoc in the code for better understanding and I believe You already have good knowledge on Spring and Hibernate. The main motto of this tutorial is to give an idea on how you can integrate Liquibase with Spring and Hibernate. If you are new to Liquibase : Click Here To integrate liquibase into your project, you need liquibase jars, So  download it before starting the project. I have created an application named "SHLIntegration". The Structure of the project is as follows : The dependencies are also listed here: Lets start with Employee class : 1. Create Employee class having getter/setter and add proper JPA annotation to each variable as below.   public class Employee {     @Id     @GeneratedValue     @Column(name="EMPLOYEE_ID")     private long id;     @Column...