[jboss-user] [EJB 3.0] - Is Map allowed as @CollectionOfElements?

lhoriman do-not-reply at jboss.com
Wed Jul 19 20:32:31 EDT 2006

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

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


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959387#3959387

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959387

More information about the jboss-user mailing list