【问题标题】:ManyToOne and Column Conflict [closed]多对一和列冲突[关闭]
【发布时间】:2021-06-03 21:56:55
【问题描述】:

错误:@ManyToOne 属性上不允许使用@Column:com.spring.mysql.test.api.model.Lancamentos.categoria

    @ManyToOne
    @Column(name="id_categoria")
    private Categoria categoria;

【问题讨论】:

  • 请发布您正在执行的代码、您尝试实现的目标以及包含完整堆栈跟踪的异常。
  • 请提供更多上下文和代码

标签: java spring-boot spring-data-jpa many-to-one identity-column


【解决方案1】:

使用@JoinColumn 而不是@Column。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-11-11
    • 2021-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-12
    • 2012-05-16
    相关资源
    最近更新 更多