Reading rows partially using CMP?

Discussions

EJB programming & troubleshooting: Reading rows partially using CMP?

  1. Reading rows partially using CMP? (3 messages)

    1. Supposing I have a bean (say, 'User') with the fields: userID, userName, customerID. A bean maps to a row in the table. So when I do a find, I get the entire row.

    Is it possible to have an equivalent of:
     
    select userID, userName from ...

    2. Suppsing user has a CMR relationship with Customer (customerID, customerName,...). Is it possible to do a User.getCustomerName() ? (Of course i can do a User.getCustomer().getCustomerName())

  2. why not.. do that in ur "ejbLoad()" method.. and u want to update the database.. do that in ur "ejbStore()" method.. i suggest u do the loading by calling the Customer bean..
  3. Actually, it's not a problem if I'm using BMP. What i need to know is, how do i go about it using CMP ?
  4. You can do it if AppServer supports lazy load