2 Replies Latest reply on Jan 22, 2003 11:43 AM by chavan

    Complex aggregate objects as entity beans?!?

    davout Newbie

      A newbie question about modelling complex objects as entity beans...

      Take the following project/phase/task example...

      class Project {
      private Vector fPhases;
      private fName
      int getPhaseCount()
      Phase getPhases(int idx)
      void addPhase(Phase aPhase)
      String getName();
      void setName(String aValue)
      }

      class Phase {
      private String fName;
      private int fOrder;
      private Vector fTasks;
      int getTaskCount()
      Task getTasks(int idx)
      String getName();
      void setName(String aValue)
      void setOrder(int aValue)
      void addTask(Task aTask)
      }

      class Task {
      String fName;
      int fID
      String getName();
      int getID();
      void setName(String aValue);
      void setID(int aValue)
      }

      If I setup 'Project' as an entity bean and I use CMP, for a 'find()' call will the CMP manager load the entire project/phase/task structure into the newly created instance or what? Is it possible to have the phase and task sub areas loaded on demand?

      Alternatively is this the right approach for EJB?