What you migth want are EJB-Selects, they allow
you to do something like
SELECT c.name FROM Customer AS c WHERE c.id=?1
EJB-Selects are descibed in the JBoss dokumentation
and are supported by special XDoclet-Tags.
No, your select does only select the name of a single customer.
What I want to do is to select the names of all customers. Maybe my customer is a very big Entity-Bean. It could be than much faster only to select their names. The result should be a collection of Strings.
Or it would perfect to select the value-objects of all customers. This would be very flexible.
Well, just forget the WHERE clause and you will get
the names of all customers. Anohter possibillity is to define
load-sets that correspond with the Xdoclet-defined value-objects.
(You can define more than one VO for an EB).
Well, just forget the WHERE clause and you will get the names of all customers.Correct, but I get all the rest of the customer, too. Try it. JBoss may be not able to give only parts of an Entity-Bean.
Anohter possibillity is to define load-sets that correspond with the Xdoclet-defined value-objects.Yes, that's why selecting VOs whould be very flexible and fast. But how can I select a VO with EJB-QL?
you should really make yourself familiar with
the documentation of Jboss, it will help you understand
how ejb-selects are _different_ from ejb-finder methods.
They ARE used to retrieve only a single field of
an entity bean. You also should take the time
and read the chapter about load-sets and other