0

ヘルプが必要です。マップを使用しようとしていますが、次のエラーが発生しました。

原因: org.hibernate.MappingException: タイプを判別できませんでした: java.util.List、テーブル: Schedule_assignedRoles、列: [org.hibernate.mapping.Column(assignedRoles)] at org.hibernate.mapping.SimpleValue。 getType(SimpleValue.java:390) org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:363) org.hibernate.mapping.Collection.validate(Collection.java:310) org.hibernate.mapping.IndexedCollection .validate(IndexedCollection.java:74) at org.hibernate.boot.internal.MetadataImpl.validate(MetadataImpl.java:333) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:443) at org. hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802)

ここに私のコード:

@Entity
public class Schedule extends PersistentObject implements Comparable<Schedule> {
   private String title;

   @ManyToOne
   private Agent target;

   @ElementCollection
   @MapKeyColumn(nullable = false)
   @Column(nullable = false)
   private Map<Long, List<Role>> assignedRoles = new HashMap<>();

   //gets e setters
}

ありがとう!:D

4

1 に答える 1