我想对我的可嵌入类进行后期处理,以将其转换为其他类型
@Embeddable
public class Identity {
private Long id;
private String alias;
}
@Embeddable
public class virtualIdentities {
private Long id;
private List<String> aliases; //AttributeConverter applied from a ","-joined string
}
@Entity
public class Parent {
private Identity identity; //Works flawlessly
private VirtualIdentities vIdentities; //Works flawlessly but...
private List<Identity> vIdentities; //<- That is what I'd like to achieve!!
}
所以我正在寻找一种机制(最好是标准JPA),它允许我将VirtualIdentities
可嵌入实例映射为List<Identity>
如果我能做AttributeConverter<List<Identity>,VirtualIdentities>
...