org.hibernate.MappingException: Unable to find column with logical name

前端 未结 3 594
盖世英雄少女心
盖世英雄少女心 2020-12-31 01:21

hi my tables are as follows:

1- medical_company:

  • medical_company_id foreign key on account_entity ta
3条回答
  •  臣服心动
    2020-12-31 01:30

    For those who ran into this problem and are using globally_quoted_identifiers, this helped me:

    Change

    @JoinColumns({
        @JoinColumn(name = "new_col_1", referencedColumnName = "ref_col_1"),
        @JoinColumn(name = "new_col_2", referencedColumnName = "ref_col_2")
    })
    

    To

    @JoinColumns({
        @JoinColumn(name = "new_col_1", referencedColumnName = "`ref_col_1`"),
        @JoinColumn(name = "new_col_2", referencedColumnName = "`ref_col_2`")
    })
    

    Notice the backtick wrapping the referencedColumnName value.

提交回复
热议问题