我有一个 Person 实体,其中包含两个 Phone Embeddable 对象。电话有一个@XmlElement
被叫type
。这不会映射到 Person 实体中的任何列。
此电话在 Person 实体中嵌入了两次。当我运行程序时,它显示编译错误org.hibernate.MappingException: Repeated column in mapping for entity: type
。我知道type
电话被嵌入两次时重复了两次。
如何覆盖@XmlElement
每个嵌入中的名称?或者任何其他方式忽略仅在 Person 实体中嵌入该元素?还有其他选择吗?