-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Mapping problem
PostPosted: Mon Jan 07, 2008 10:17 am 
Newbie

Joined: Sun Jan 06, 2008 7:52 am
Posts: 3
I have a problem with mapping. Maybe some one can help me.

Code:
@Entity
@Table(name="A")
Public class A{
   private List<ArrayList<ArrayList<B>>> bs =
              new ArrayList<ArrayList<ArrayList<B>>>();

    @OneToMany
    public  List<ArrayList<ArrayList<B>>> getBs(){
                     return bs;
     }

    public void setBs(List<ArrayList<ArrayList<B>>> bs){
                this.bs = bs;
    }
}


Code:
@Entity
@Table(name="B")
Public class B{
    private String name;

    public  String getName(){
         return this.name;
    }

    public void setName(String name){
         this.name = name;
  }
}


Here is the Exception
Code:
State: FAILED
  Reason: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: A.bs[java.util.ArrayList]


can Hibernate not support the datastructure List<ArrayList<ArrayList<B>>>?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 07, 2008 11:57 am 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Well, in principle, children are indicated as some sort of simple collection (a Set, a List), not as a collection of collections, nor anything that complicated.

If you want several "levels" of collections, you should rethink your design so that there are more entities in the middle, each containing a simple collection.

_________________
Gonzalo Díaz


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.