title: Using XPages Toolkit Domino Storage Service to load a tree of objects into Java Objects
body: <p>I'm building an application that allows user to register for a particular session for a particular course.</p>
  
  <p>The data is structured like a tree, i.e. one course can have many sessions who can have many registrations.</p>
  
  <p>I've built up views with unique IDs for each object, including the id of the parent object.</p>
  
  <p>What I'm now trying to do is setting up my XPage so that all the data gets loaded into memory, so that I can access all the data directly through the java objects instead of binding directly to the views (which is just ugly).</p>
  
  <p>I'm thinking of building the objects like this:</p>
  
  <pre><code>public class ApplicationBean implements Serializable {
  
  private Set&lt;Course&gt; courses;
  
  public void addCourse(Course input){};
  
      public void initialize {
        - load all courses, sessionns, registrations from flat Notes Views
        - updates 
  };
  }
  
   public class Course implements Serializable {
   private Set&lt;Session&gt; sessions;
  
   public void addSession(Session input){}
  
   }
  
  public class Session implements Serializable {
  
      private Course parent;
      private Set&lt;Registrations&gt; registrations;
      public Course getParent(){}
      public void addRegistration(Registration input) {}
  
  }
  
  
  public class Registration implements Serializable {
  
      private Session parent;
      public Session getParent(){}
  }
  </code></pre>
  
  <p>An example is: Show me the list of all the courses that I have registered for. I would like a list which shows:</p>
  
  <pre><code>registration session(from parent of registration) course (from parent of session)
  </code></pre>
  
  <p>where the rows would be filled in with</p>
  
  <pre><code>registration.description   registration.session.title registration.session.course.title
  </code></pre>
  
  <p>I've looked into the Domino Storage Service (DSS) from Christian Güdemann's XPages toolkit and it looks really promising; all the Database Access Object bits of the logic are automagically created. I'd like to use this but the example database just shows a simple, flat data - contacts.</p>
  
  <p>I'm thinking of having some sort of applicationBean which, when first loaded, loads all three flat lists of objects into memory and then creates in a second step the linking between the objects.</p>
  
  <p>What would be the best solution here? Any suggestions?</p>