Why am I getting Mapping Exception?

前端 未结 3 1896
孤城傲影
孤城傲影 2021-01-29 04:49

I am getting :

org.hibernate.MappingException: Foreign key (FKBB979BF4266AA123:address [a_id]))
must have same number of columns as the referenced 
primary key (         


        
3条回答
  •  自闭症患者
    2021-01-29 05:32

    You need to create a reference table:

        CREATE TABLE PersonsAddresses (personId BIGINT, addressId BIGINT)
    

    and change the mapping of the set to this:

        
            
            
        
    

提交回复
热议问题