Liquibase Hibernate and composite-id

Hi there,


I’m trying to get a composite-id to work with liquibase but I can’t get it done.


  1.  
  2.    
  3.    
  4.        
  5.      
  6.      
  7.    
  8.     
  9.    
  10.  
I get the following error:


org.hibernate.MappingException: entity class not found: com.my.domain.ExamFormAttribute

at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:137) 

Any idea?

To explain a bit more, I am trying to generate my changelog from my hibernate files. If I put a simple id field it works great but as soon as I do a composite-id, it fails. I have a relation A-----[order]------B so I need to map a table with A_id, B_id + my parameter [order]. Liquibase-hibernate can’t seem to be able to generate a changelog from that.

I’ve been trying different mapping and can’t get liquibase to understand them. My mapping is validated by hibernate, hbm2ddl understands and creates the table with the right primary/foreign keys.


Does the liquibase-hibernate ext even support the composite-id mapping? 


Thx 

It must not be handling that correctly. Liquibase reads the metadata provided by hibernate, but composite IDs are probably an edge case not handed correctly.


I created https://github.com/liquibase/liquibase-hibernate/issues/28 to track the problem.


Nathan

Thank you!Ok, I hope it will be fixed in future revisions. 

Just to follow-up on this and if someone get this kind of problem, a workaround is to use composite-element as explained here. Doing so is supported by the extension and creates the right table/keys.