0 Replies Latest reply on Jun 30, 2006 1:24 PM by sholodak

    My @OneToMany Collection<String>'s stopped working between 4

    sholodak

      Hi all,

      I'm trying to upgrade from 4.0.4.CR2 to GA. I had hoped that moving my application's EAR over to the new server would just work, but it isn't. I'm getting AnnotationExceptions now stating that I'm using @OneToMany to target an unmapped class. I was under the impression that certain primitive types would be automatically taken care of and that String was on that list.

      Offending Code:

      private Collection<String> actions = new ArrayList<String>();
      
      @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
      public Collection<String> getActions() {
       return this.actions;
      }
      


      Relevant Output:
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:ear=Registry.ear,jar=forms-ejb.jar,unitName=Registry
       State: FAILED
       Reason: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: [...].form.model.todo.Review.actions[java.lang.String]
      


      I'm looking through the final versions of the JSR, but I can't find any relevant information. I've also been looking through the JBoss and Hibernate docs but haven't turned anything up yet.

      Has anyone dealt with this problem / can anyone help me out with this? Do I need to make wrapper classes for these Strings so that the object in the collection is explicitly defined as an Entity?

      Thanks,
      Scott