3 Replies Latest reply on Oct 26, 2005 7:57 AM by haller

    EJB3 hibernate mapping exception

    haller

      Hi,

      I resembled the IDETrail sample with 1.5RC1
      and Jboss 4.0.3.

      I've got the following message deploying:

      2005-10-23 22:00:39,634 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: de.interactive.ejb.demo.Author
      2005-10-23 22:00:39,634 DEBUG [org.jboss.ejb3.Ejb3Module] Initialization failed jboss.j2ee:service=EJB3,module=authors-beans.ejb3
      org.hibernate.MappingException: Could not determine type for: java.util.Collection, for columns: [org.hibernate.mapping.Column(articles)]

      @Entity
      public class Author {
      private int authorId;
      private String name;
      private Collection articles;

      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "authorId")
      @JoinColumn(name = "authorId")
      public Collection getArticles() {
      return articles;
      }
      ...

      @Entity
      public class Article {
      private int articleId;
      private String title;
      private String body;
      private Author author;

      @Id(generate = GeneratorType.AUTO)
      @Column(name = "articleId")
      public int getArticleId() {
      return articleId;
      ...

      Any suggestions?