You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by ol...@ppi.de on 2003/08/04 10:19:58 UTC

nested queries, collection fields, and projections

Hello,

apart from my previous posting concerning nested queries
with subqueries over extents, I have some more questions
about nested queries.

In the method 
 Criteria.addIn(String attributeName, Query subQuery)
is the specified attribute allowed to be a collection 
attribute? (The method is not used in any of the tests,
so it is difficult to tell.)

If not, how am I supposed to get by without?
Say I have a (sub)query q that specifies a set
of persons, and I want to query for all projects
that have a person that fulfils q.

In my situation, the relation under consideration is
1-n, so I do not need an indirection table.

I could use a different feature I would like to
call 'projection': 

Give me (distinctly) the set of all project_id values
for all persons that fulfil q.

Queries of the above type are also required by OQL,
so I wonder if OJB supports them.  I have not
found it.  I would expect a method
	Collection Query.projectTo(String attributeName)
to do that.

Can anybody help me?  Can we implement such a feature?

Olli


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org