该
@JoinColumn批注指定列的名称被用作对目标实体的外键。
在
Product上面的类中,连接列的名称设置为
ID_CATALOG。
@ManyToOne@JoinColumn(name="ID_CATALOG")private Catalog catalog;
但是,
Product表上的外键称为
catalog_id
`catalog_id` int(11) DEFAULT NULL,
您需要更改表上的列名或您在中使用的名称,以
@JoinColumn使它们匹配。参见http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html/entity.html#entity-
mapping-
association



