Day02:

作者: 宇宙超人喵学长 | 来源:发表于2017-07-13 14:41 被阅读0次
    • 1、内嵌类型

    @Embeddable 描述映射类型本身
    @Embedded 引用给定的可嵌入类型

    一个Entity中映射多个相同的内嵌类型时,需要关联列名

    @Embedded
    @AttributeOverrides(
    @AttributeOverride(
    name = "line1",
    column = @Column( name = "home_address_line1" ),
    ),
    @AttributeOverride(
    name = "line2",
    column = @Column( name = "home_address_line2" )
    ),
    @AttributeOverride(
    name = "zipCode.postalCode",
    column = @Column( name = "home_address_postal_cd" )
    ),
    @AttributeOverride(
    name = "zipCode.plus4",
    column = @Column( name = "home_address_postal_plus4" )
    )
    )
    private Address homeAddress;

    相关文章

      网友评论

          本文标题:Day02:

          本文链接:https://www.haomeiwen.com/subject/haobhxtx.html