0 Replies Latest reply on Jul 19, 2006 8:32 PM by lhoriman

    Is Map allowed as @CollectionOfElements?

      Is it possible to have a @CollectionOfElements which is a Map? Using JBoss 4.0.4.GA:

      @CollectionOfElements
      @JoinColumn(name="blahId")
      @MapKey(name="foo")
      Map<String, Thing> things;
      
      (Thing is @Embeddable)


      Gives me:

      org.hibernate.AnnotationException: Associated class not found: com.kink.heart.entity.Thing
       at org.hibernate.cfg.annotations.MapBinder.bindKeyFromAssociationTable(MapBinder.java:95)
       at org.hibernate.cfg.annotations.MapBinder.access$000(MapBinder.java:55)
       at org.hibernate.cfg.annotations.MapBinder$1.secondPass(MapBinder.java:78)
       at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
      ...


      If I change the collection type to Set, everything works.

      Is Map not supported? Will it be in the future?

      Thanks,
      Jeff