Advertisement

12.27.2006 at 09:06AM PST, ID: 22104223
[x]
Attachment Details

findBymethods in Entity beans

Asked by jaggernat in Java Programming Language, Enterprise Java Beans (EJB)

Tags: findbymethods, bean, collection, entity

Hi experts
this is my findBy method() and create method in home interface of Entity bean :
public Collection findByName(String string) throws FinderException,RemoteException;
public com.sample.entitybean.SampleEntitybean 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”).iterator();
While(i.hasNext())
{
SampleEntitybean product =( SampleEntitybean)portableRemoteObject.narrow(i.next(),SampleEntitybean.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
 
Keywords: findBymethods in Entity beans
 
Loading Advertisement...
 
[+][-]12.27.2006 at 11:36AM PST, ID: 18204181

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.27.2006 at 02:04PM PST, ID: 18205044

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.27.2006 at 02:37PM PST, ID: 18205214

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Programming Language, Enterprise Java Beans (EJB)
Tags: findbymethods, bean, collection, entity
Sign Up Now!
Solution Provided By: natgross
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.19.2007 at 11:41AM PST, ID: 18351793

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.19.2007 at 09:35PM PST, ID: 18354831

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32