persistence@glassfish.java.net

Cascade Join query involving collection attributes

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Mon, 31 Mar 2008 15:44:51 -0400
Dear Colleagues,

This is probably a very simple question but I am having trouble coming up with the correct query.

The Object Model for Entity classes looks as follows.

ObjectModel for Entity Classes


I am trying to determine a parameterized query that will match all things that have a name and description that match specified pattern using :name and :description
query parameters. I want to make sure that if a Thing has 0 Name (or Description) then if :name (or :description is '%') then the Thing should match the query.

I am not exactly sure how to deal with the fact that we have to navigate thru multiple levels of collection attributes for each of the following:
Also I am not sure how to cope with the possibility that:
Any help on this query would be greatly appreciated. Thanks.
-- 
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com


ThingNameDesc.gif
(image/gif attachment: ThingNameDesc.gif)