Oh boy... OK, maybe that was a bad example. "Read more about entity beans"
is not very useful advice in any case. I just didn't want to explain our
business model to ask the question.
Try the situation where the top level is Vehicle -> Manufacturer -> Model or
something many-to-many on each layer. My point is that I want to be able to
"skip a layer" in the finder. Is that possible? If you don't know, or the
answer is no, please just say that or ignore my question and move on. If
you have an actual answer or alternative approach that might work, I'd be
very appreciative to hear it.
For what it's worth, I want to do it this way, as opposed to using some kind
of bean-based (logical model) test or pseudo-BMP thing because, due to the
volume of "3rd level (in my example)" entities running a findAll on them is
performance-limiting and I'd rather not stick SQL directly in my beans.
Thanks,
Rian
--
Rian Schmidt
[EMAIL PROTECTED]
----- Original Message -----
From: "elephantwalker" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 2:54 PM
Subject: RE: findBy referencing another entity reference
> Rian,
>
> This is much too sql centric. You should resolve your entity beans around
> business methods. So I would start off by reading more about entity beans.
> Theserverside.com, for example has a download on an excellent book for
> entity beans. As for the sql, you are talking a one to one relationship
for
> the car/model and a one to many relationship for the manufacturer/model.
> There should be some examples of this on the sun's j2ee site. I know that
> they specifically discuss this issue.
>
> Regards,
>
> the elephantwalker
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rian Schmidt
> Sent: Monday, April 16, 2001 2:23 PM
> To: Orion-Interest
> Subject: findBy referencing another entity reference
>
>
> Hi all,
>
> How about this scenario:
> There are three entities: manufacturer, model, car (as an example)
> model knows directly which manufacturer it is, car knows which model it
is,
> but car has to do a model.getManufacturer to find out its manufacturer...
>
> OK, so what I wanna know is can I a findByManufacturer for car? I'd
> like to be able to do something like this:
> query="$model.manufacturer = $1"
>
> Now, I know that I could specify a sub-query with the actual persistence
> name of the other entity's thang, something like:
> query="$model in (select $model from model where manufacturer_id = $1)"
> but it strikes me that Orion won't know what I'm going on about, and best
> case, will have to talk to the database each time. Either way, I had to
put
> the persistence name into the orion-ejb-jar.xml file, which is not
goodness.
>
> Is it possible maybe to say something like:
> query="model in ($1)"
> where $1 is a Collection of models taken from
ModelHome.findByManufacturer?
>
> Any thoughts on the best way to approach this?
>
> Thanks,
> Rian
> --
> Rian Schmidt
> [EMAIL PROTECTED]
>
>
>