0
鑑於一些實體是這樣的:子類如何覆蓋繼承關聯的映射,以便它被忽略(未爲子類實體映射)?
@MappedSuperclass
public abstract class BaseEntity {
@ManyToOne(optional = true)
@JoinColumn(name = "friend_id")
private AnotherEntity friend;
}
@Entity
public class AnotherEntity {
// ...
}
@Entity
public class ConcreteEntity extends BaseEntity {
//...
}
如何ConcreteEntity
覆蓋的friend
映射,使其不被映射在所有的ConcreteEntity
實例?