JPA:@ManyToOne关系的默认列名映射

11 浏览
0 Comments

JPA:@ManyToOne关系的默认列名映射

当我们有一个类时:

@Entity
Order实现Serializable {
    @Id
    private Integer id;
    ...
}

以及:

@Entity
OrderLine实现Serializable {
    @Id
    private Integer id;
    @ManyToOne
    Order order;
    ...
}

属性order将映射为哪个列名?

order_id, ORDER_ID还是Order_id?

(故意省略@JoinColumn(name='order_id'))

0