Dominic Savio wrote:
>
> I suppose you have mapped the Imagedata field to BLOB database type.
> If I understand correctly, even if the container retrieves all attributes
> of the bean (result of ejb-ql), the Imagedata field will be just a handle
> to the stream object. Unless we invoke any method on that, i think the
> handle will not retrive the actual data from the data source.

> On Fri, 3 Aug 2001 12:14:34 +0100, Ian McCallion <[EMAIL PROTECTED]> wrote:
>
> >Suppose I have an entity called Image with four CMP fields:
> >
> >- Primary Key
> >- Description (100 bytes)
> >- Date (8 bytes)
> >- Imagedata (1 meg)
> >
> >I'd like to implement an ejbSelectByDate(Date) method that selects (PK,
> >Description) and use this  method in a ejbHomeGetDescriptionsOn(Date) method
> >that simply returns the data to the client so that I can display the
> >descriptions to the user who can then select images to view based on the
> >descriptions.
> >
> >As far as I can see, this is straightforward with SQL, but impossible with EJB
> >QL. Have I missed something?

Dominic, that's a good point for the particular case of mapping a large field to
a BLOB. It is not getting to the heart of the problem though, as I'll still have
to instantiate each Entity Bean, involving a minimum of n+1 SQL calls to get
what I can get in a single SQL call. According to the spec:

  SELECT l.product FROM Order AS o, IN(o.lineItems) l

returns a list of products specified in a particular Order. On this basis:

  SELECT l.quantity FROM Order AS o, IN(o.lineItems) l

would presumably return a list of quantities of the products ordered. But there
is no way of correlating the two lists, and no way of getting a combined list.
What we'd like to be able to do is have:

 SELECT (l.product, l.quantity) FROM Order AS o, IN(o.lineItems) l

return a simple serializable collection of value objects containing product and
quantity. Perhaps this is one complication too far for the spec writers at this
stage, but it seems to limit the usefulness of EJB QL quite severely.

========================================
Ian McCallion
Alexis Systems Limited
Romsey, UK
Tel: +44 1794 514883
Fax: +44 1794 501692
========================================

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to