2012-02-18 111 views
1

我想知道是否有可能在jpa管理实体中具有以下数据结构。是否可以坚持包含另一个集合的地图

@Entity 
public MyEntity { 

    @ElementCollection 
    public Map<String, Set<MyEntityTwo>> map; 
} 

我做了一些基本的测试,但拿出了以下错误:

JPA error 
A JPA error occurred (Unable to build EntityManagerFactory): Could not determine type for: java.util.Set, at table: ModelOne_map, for columns: [org.hibernate.mapping.Column(map)] 

play.exceptions.JPAException: Unable to build EntityManagerFactory 

回答

2

发现这个link其中指出,这是不可能与标准JPA,而且首选的方法是创建一个包装目的。

相关问题