Creating a view using code.

Could be a bug. As I said, this is a very non-standard usage, so this use case may not have been tested before. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Excellent!

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

I am generating this changeSet using CreateViewChange.java  but when I run the changelog is not executing the sql query.

       

 

I tried with CreateView but I can’t create something like this:

> "cat" "true" "public"  I will be grateful if you help me.

Hi Steve,

I have a class with 4 fields that is supposed to map to a view. So I need to create that view in my code. I want to create 

> "cat" "true" "public" 

BTW, should I use CreateView or CreaeViewChange?

Yes, I did used >

I was able to get the desired result using setValue() method of CreateView class.

It isn’t completely clear what you are trying to do. The second syntax is correct. Your first example is incorrect. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

OK, if I understand correctly, you are creating the changelog using java code? If so, please understand that yours is a fairly unusual situation. I don’t know of anyone else doing that.

In that case, yes, you should be using the CreateViewChange class, and you can set the select part of the change by calling CreateViewChange.setSelectQuery. When Liquibase serializes the change to XML, this value will be written to the correct location.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/