Day02:

2017-07-13  本文已影响0人  宇宙超人喵学长

@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;

上一篇下一篇

猜你喜欢

热点阅读