This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes How to implement Home Method in Entity Bean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "How to implement Home Method in Entity Bean?" Watch "How to implement Home Method in Entity Bean?" New topic
Author

How to implement Home Method in Entity Bean?

Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643


Above is code for home interface and bean class
in Home i have independent home method getAllEmpNames
in bean i have ejbHomeGetAllEmployeeNames for getAllEmpNames
ejbHomeGetAllEmployeeNames uses ejbSelectGetAllEmpNames method.

First of all i want to know is i am using correct procedure or there is something missing.
Second why it throws error.
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
sorry for duplicate post.
Suresh Babu Shanmugam
Greenhorn

Joined: Dec 11, 2006
Posts: 23
Hi,

In home interface, in your case return type should be Collection not just String.


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

In Bean,


//Query for ejbSelectGetAllEmpNames SELECT OBJECT(m) FROM Employee m
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//if Return EJBs Of Type is Remote
/*then at deploy time it says RemoteException Error processing ejb jar compilation failed*/
Should have remote interface for the Entity Bean. In your case, it should be Remote, because you are returning the Collection obtained from ejbselect method to a remote client

//if Return EJBs Of Type is None
If you give 'None' or 'Local', it will take it as 'Local'

Hope this reply helps you to resolve issues. If i am wrong please correct me.
[ February 19, 2007: Message edited by: Suresh Babu Shanmugam ]

Regards,
Suresh Babu
SCJP 1.4
SCBCD 1.3
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to implement Home Method in Entity Bean?
 
Similar Threads
java.lang.NullPointerException: EJB 2.0
How to implement Home Method in Entity Bean?
ejbSelect Method in CMP
problem in bmp deployment
Error: [ ejbFindByPrimaryKey ]