create method of CMP beans
Hi,
Most of the CMP examples I have seen had this format
create(String customer_id, String customer_name, String age)
If there a special reason for doing this instead of passing a Customer object to create method.
create(Customer customer)
Thanking You,
Chamal.
[304 byte] By [
chamalsla] at [2007-10-3 4:10:25]

> Most of the CMP examples I have seen had this format
>
> create(String customer_id, String customer_name,
> String age)
>
> If there a special reason for doing this instead of
> passing a Customer object to create method.
>
> create(Customer customer)
No, but for the example it's easier that way as there's no need to define that Customer object.
BTW, in a real system you'd likely have the ejbCreate be responsible for creating the ID rather than the calling system, in order to ensure it's indeed unique for use as the primary key.
You'd then in the calling client retrieve it by calling getPrimaryKey() on the freshly created RemoteObject (or LocalObject).