Finder methods to find all (CMP)

K

kgeffen

Hi,

I'm searching for ways to create a finder method for an entity bean to
find all rows in a table. I recently found a post on it but i cant
seem to find it anymore.

Can someone help me on my way on this subject. I'm looking for some
ways to select all data from a database, instead of using findByXXX
methods. One way i thought it may work is a whereclause (1=1) or
something.

Does someone has a suggestion?

Tnx
 
S

Sudsy

kgeffen said:
Hi,

I'm searching for ways to create a finder method for an entity bean to
find all rows in a table. I recently found a post on it but i cant
seem to find it anymore.

Then you don't want a finder, you want a select, something like
selectAll:

public abstract Collection ejbSelectAll() throws FinderException;

Then just write the corresponding EJB-QL, somthing like:

select object (c) from TABLENAME c

where TABLENAME is the name of your table or view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top