0 Replies Latest reply on Feb 24, 2005 12:57 AM by Jeremy Green

    FetchType.EAGER and tree structures

    Jeremy Green Newbie

      First I'd like to say that I like what I see so far with ejb3. Thanks for the hard work.

      I'm trying to implement a large tree structure using ejb3 and I'm wondering how exactly the fetch type is going to affect things. For the main structure of the tree there is one @Entity called Node. Each node has a reference to a single Node parent and a Collection for children. The relationship is set up using the @OneToMany and @ManyToOne annotations. This will be a large data set that will be viewed in smaller chunks which will be just subsets of the whole tree. For example "start at Node X and show 3 levels deep". If I set the FetchType to EAGER, will that force the entire tree to be loaded? Basically I'm just wondering how FetchType.EAGER will affect a very large tree structure.

      Thanks in advance for any input anyone has on this.

      Jeremy