Giter Club home page Giter Club logo

Comments (2)

dolavb avatar dolavb commented on July 26, 2024

I have the same issue. It happens when the primary key is made of several columns and not generated by an ID annotation. One of the example I have in my code looks like this:

@OneToMany(cascade=CascadeType.ALL)
@MapKeyClass(Key.class)
private Map<Key, Enitty> entities; 

In this case I end up with a primary key named PRIMARY in MySQL. However the named in the hibernate primary key is set to null. I haven't confirmed in the hibernate generated DDL, but I believe this name is RDBMS specific and is set when no name is specified when creating a PK. So it could be something else for other database.

I got it working by adding something like this

if(hbnPrimaryKeyName==null){
   hbnPrimaryKeyName = "PRIMARY";
}

in the addTo method of the PrimaryKeySnapshotGenerator. This is not a fix but I believe it helps to pin points the source of error to the piece of code that covers the cases of truncated key names.

from liquibase-hibernate.

nvoxland avatar nvoxland commented on July 26, 2024

Thanks for the test cases, that helps. The main problem was that I had fixed the issue in liquibase-hibernate/master but you are using the 4.2 branch. Since you are running against Hibernate 4.3.6 you can just use the liquibase-hibernate artifact. That version supports 4.3+ Is there a reason you were using liquibase-hibernate4.2?

I did merge master into the 4.2 branch and push the changes up which should fix it on both branches now.

from liquibase-hibernate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.