6

I followed these steps to get liquibase-hibernate working. I hope I correctly understood the instructions in the wiki.

Our hibernate entities are declared in the file applicationContext.xml. We do not have a hibernate.cfg.xml. My liquibase properties are:

url=jdbc:postgresql://localhost:1234/MY_DATABASE
username=user
password=pass
referenceUrl=hibernate:spring:somePackage?dialect=org.hibernate.dialect.PostgreSQLDialect

The thing is no matter what I enter as somePackage, liquibase shows everything (tables, columns, constraints) as "unexpected". Liquibase "finds" somePackage even if it does not exist.

liquibase diff
INFO 09.08.17 10:41: liquibase-hibernate: Reading hibernate configuration hibernate:spring:somePackage?dialect=org.hibernate.dialect.PostgreSQLDialect
INFO 09.08.17 10:41: liquibase-hibernate: Found package somePackage

And the comparison result is like

Reference Database: null @ hibernate:spring:somePackage?dialect=org.hibernate.dialect.PostgreSQLDialect (Default Schema: HIBERNATE)
Comparison Database: postgres @ jdbc:postgresql://localhost:1234/MY_DATABASE (Default Schema: public)
Compared Schemas: HIBERNATE -> public
Product Name:
     Reference:   'Hibernate'
     Target: 'PostgreSQL'
Product Version:
     Reference:   '4.3.11.Final'
     Target: '9.5.4'
Missing Catalog(s): NONE
Unexpected Catalog(s): NONE
Changed Catalog(s):
     HIBERNATE
          name changed from 'HIBERNATE' to 'MY_DATABASE'
Missing Column(s): NONE
[...]
Unexpected Table(s):
    activityentity
    addressentity
    advertisemententity
    advertisementusageentity
    [...]

I really don't know what's going on or whether I'm doing something wrong. Any help would be appreciated.

Monkey Supersonic
  • 1,165
  • 1
  • 10
  • 19

0 Answers0