I am new to this form. Please explain when 2 use ejbSelect method in a bean?
Thank you.
-
When 2 use ejbSelect() method? (2 messages)
- Posted by: Ghanshyam Dontula
- Posted on: September 24 2004 13:08 EDT
Threaded Messages (2)
- When 2 use ejbSelect() method? by Arun Nair on September 27 2004 04:33 EDT
- When 2 use ejbSelect() method? by Suresh Babu Chandrasekar on September 27 2004 05:54 EDT
-
When 2 use ejbSelect() method?[ Go to top ]
- Posted by: Arun Nair
- Posted on: September 27 2004 04:33 EDT
- in response to Ghanshyam Dontula
ejbSelect provides a more flexible method to query the database than find methods. Find methods belong to a home interface and only return
the corresponding local object. A findStudent method in StudentHome can only return a Student or a collection of Students.
ejbSelect methods can return any type in the database or a collection of database objects. They are restricted to the entity bean implementation class; you'll need to write a separate business method to expose the results of the query.
Like find methods, ejbSelect methods use the deployment descriptor to define the EJB-QL query. Resin-CMP will generate the appropriate SQL for the select.
Example Query -
SELECT student.age
FROM select_house house, IN(house.studentList) student
WHERE student.gender='Boy' AND house= ?1
ORDER BY student.name
-arun -
When 2 use ejbSelect() method?[ Go to top ]
- Posted by: Suresh Babu Chandrasekar
- Posted on: September 27 2004 05:54 EDT
- in response to Ghanshyam Dontula
Hi,
ejbSelect() method is use to return local object ,collection and data types. If u want to use the records within the entity bean means u can use ejbselect(). Suppose if u want to pass the resultant value to client side means u have to use ejbFind()