-
1. Re: EJB QL: Selecting anything different than entity beans
stscit04 Dec 21, 2004 9:52 AM (in response to airmer)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.
Regards,
Stefan -
2. Re: EJB QL: Selecting anything different than entity beans
airmer Dec 21, 2004 11:17 AM (in response to airmer)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. -
3. Re: EJB QL: Selecting anything different than entity beans
stscit04 Dec 21, 2004 11:19 AM (in response to airmer)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).
Regards,
Stefan -
4. Re: EJB QL: Selecting anything different than entity beans
airmer Dec 22, 2004 8:26 AM (in response to airmer)Hi Stefan,
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? -
5. Re: EJB QL: Selecting anything different than entity beans
stscit04 Dec 22, 2004 8:56 AM (in response to airmer)Arne,
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
optimizations.
Regards,
Stefan