Hello community !!
This my first post and come with job for yours usahsa nneed help :(
I'm using annotations to map ... i have two class, one class has two ids and other only one, i using AssociationOverrides and always occurs this erro :
how make associantionOverrides with composit ID?
Exception in thread "main" org.hibernate.MappingException: Foreign key (FK_ProEAdvrocessos_E_Advogados [processo_pro_codigo])) must have same number of columns as the referenced primary key (Processos [pro_codigo,pro_Acusacao])
Code:
@AssociationOverrides({
@AssociationOverride(name = "IA.advogado", joinColumns = @JoinColumn(name = "NumeroOab")),
@AssociationOverride(name = "IA.processo", joinColumns = {@JoinColumn(name = "pro_Codigo", referencedColumnName="pro_Codigo"),
@JoinColumn(name="Acusacao", referencedColumnName="pro_Acusacao")})
})