AFAIK no but this is not desirable because an Entity EJB represents a datastore record.
But still you can make it happen when you create a DB View on a table like:
CREATE VIEW ( NUMBER(5) ) AS SELECT DISTINCT Id FROM Table_XYZ;
But be warned that when you create such a view your Entity EJB can only be READ-ONLY because a DB will reject an INSERT or UPDATE on this view.
Have fun - Andy
Is 'id' the primary key? If so you just need to add a 'findAll' in your home interface.
That's what I'm working on. You should be able to do it with a CODED custom finder, which is what I'm trying to do, only I can't get it to work. It returns a collection with size of 0, and doesn't even appear to run the code.
Look in the manual:
and read the last section, "Custom finders coded in your beans".
If you get it to work, then please let me know.