当前位置: 代码迷 >> J2EE >> 没有主外键能否用annotation映射解决方法
  详细解决方案

没有主外键能否用annotation映射解决方法

热度:58   发布时间:2016-04-22 02:20:36.0
没有主外键能否用annotation映射
数据表没有主键也没有外键,但是有字段对应,就是没有生成主外键关联,用annotation能否在实体类中映射,能否像以往以对象的方式查询

------解决方案--------------------
Java code
@Entity@Table(name="test_pp")public class CategoryProdPlace {    @EmbeddedId    @Column(name="pinming_idcode",length=32)    private String categoryIdCode;        @Column(name="chandi_id",length=32)    private String prodPlaceId;    //setter getter}
  相关解决方案