有什么方法可以在Embeddable类上应用JPA AttributeConverter的排序吗?

时间:2016-10-03 13:52:36

标签: java hibernate jpa java-ee persistence

我想对我的可嵌入类进行后期处理,以将其转换为其他类型

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

0 个答案:

没有答案