@Column(s) not allowed on a @ManyToOne property

前端 未结 4 1660
忘了有多久
忘了有多久 2020-12-12 21:22

I have a JPA entity with a property set as

@ManyToOne
@Column(name=\"LicenseeFK\")
private Licensee licensee;

But when I deploy on JBoss 6

4条回答
  •  时光取名叫无心
    2020-12-12 22:12

    In my case @VaishaliKulkarni's answer was helpful to identify the problem.

    I missed to write field for @Column annotion and it effected on next field.

    @Column(name = "account_id")
    // I forgot to write field here
    
    @ManyToOne
    @JoinColumn(name = "customer_id")
    private Customer customer;
    

    So, I was getting exception at "customer" field.

提交回复
热议问题