[jboss-user] [Beginners Corner] - Newbie problem with persitence

stareagle do-not-reply at jboss.com
Thu Apr 17 08:16:58 EDT 2008


Hello,

I have a problem with the persitence in my first JBoss application. There two Beans, which have an 1:n relationship.

The problem: When I'am deploying the application, JBoss complains that I'am trying to use the OneToMany annotation on a none collection:

org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany,...

The relevant code from the class:

@OneToMany(mappedBy = "employer", cascade = CascadeType.ALL)
  | public Vector<User> getEmployees() {
  |   return this.employees;
  | }
  |     
  | public void setEmployees(Vector<User> employees) {
  |   this.employees = employees;
  | }

The attribute employees is a java.util.Vector. I'am very sure that a Vector is a Collection. I also tried other classes like LinkedList with the same result.

Can anybody help me?

Greetings 

Stareagle

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

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



More information about the jboss-user mailing list