Maven diff not working for view


When I run mvn compile liquibase:diff, the changeSet generated contains the creation of a table instead of a view. How liquibase identifies views in java code ?

The java class:

		@Table(name = "CarView")
		public class CarView {

			@Column(name = "idCar", nullable = false)
			private String id;

			@Column(name = "color")
			private String color;

The changeSet generated:

<changeSet author="ME" id="ID1">
    <createTable tableName="CarView">
        <column name="idCar" type="nvarchar(255)">
            <constraints nullable="false" primaryKey="true" primaryKeyName="CarViewPK"/>
        <column name="color" type="nvarchar(255)"/>

And likewise, if I create view manualy, it generates:

    <changeSet author="MY" id="ID2">
        <dropView viewName="CarView"/>

Thanks for your help

Hi @NAQ_HA - Welcome to the Liquibase Community!

I have been unable to find a direct answer to your question, and I know just a little bit about Java, but I have good google search skills!

Here are some of the resources I found that may help you.

  1. Using the Liquibase Java API | Liquibase Docs
  2. Database Migrations for Java Applications |

If you don’t find the information you need to figure it out, You can always post a suggestion that that functionality be investigated and added to the project at

1 Like