Hi experts
this is my findBy method() and create method in home interface of Entity bean :
public Collection findByName(String string) throws FinderException,RemoteExce
ption;
public com.sample.entitybean.Samp
leEntitybe
an create(java.lang.String productId,
java.lang.String name,java.lang.Double productPx,java.lang.String
description)
throws javax.ejb.CreateException,
java.rmi.RemoteException;
I know the create method instantiates the bean something like
Home.create(10001, tomato soup, new Double(2),Bowl of soup);
Iterator I = home.findByName(juice).i
terator();
While(i.hasNext())
{
SampleEntitybean product =( SampleEntitybean)portableR
emoteObjec
t.narrow(i
.next(),Sa
mpleEntity
bean.class
);
// SampleEntitybean is the remote interface
}
Questions
What exactly is difference between create() and findBymethods() in the home interface of an entity bean.
What operations can I do with findByName() method?
What is findByName() doing above and whats happening in the while loop?
Any ideas,
Thanks
J
Start Free Trial