0 Replies Latest reply on Oct 10, 2003 4:47 AM by gsarno

    PM behavior.

    gsarno Newbie

      I have some import question about the PM manager on JBOSS:


      QUESTION 1:

      Let's say I have two objects (user and books) which map to two
      tables in a database.

      Table USER: USER_ID USERNAME

      table BOOKS: USER_ID BOOK_ID

      with a relationship of 1 - M.

      (So the user object would have a collection of books as data member.)

      let's say I queried for a user with USER_ID = 1.

      would the PM also load all the Books associated with that user ?

      Question n'2:

      If I then fetched a particular user (USER_ID = 1)
      and I wanted to add a new book (BOOK_ID = 2)

      class user ...
      Collection books;
      ..........

      books.add( book);

      would the PM load the entire Collection ?

      In general would the PM load the whole collection when we call any method on the collection? Or when would it ?


      Thanks.
      Giuseppe.