我是Spring jpa的新手,有一个需要创建的用例:
表A:带有列'a','b'和'c'
和表B:具有列d和表A中的列。
我的问题是,
我可以用@ Entity和@ Embeddable都为Table A注释POJO吗?
You will have to put two annotation by name "@Embeddable And
@MappedSuperclass" on above the table A entity and also you will have to inherit table A entity into the table B entity like below.
@Embeddable
@MappedSuperclass
@Entity
class TableA{....}
@Entity
Class TableB extends TableA{...}