db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@jpox.org
Subject Re: [jira] Commented: (JDO-246) JPOX eliminates duplicates in the query result although DISTINCT is not specified.
Date Thu, 09 Feb 2006 19:16:22 GMT
Actually, you can project a collection field, but in fact what is projected are
the elements of the collection.

dept = {"dept1","dept2"}
dept1.employees = {"emp1","emp2","emp3"}
dept2.employees = {"emp4","emp5"}

"select employees from Department" will result in

emp1
emp2
emp3
emp4
emp5

"select this, employees from Department" will result in

dept1, emp1
dept1, emp2
dept1, emp3
dept2, emp4
dept2, emp5

I would like to know what would that be in case of Map or arrays.

Quoting Wes Biggs <wes@tralfamadore.com>:

> It doesn't make much sense to me to project to map or collection fields,
> though I don't see it explicitly discussed in the spec. I suppose if we
> allowed it, the cell would be of type Map or Collection (or etc. as
> declared).  Or am I missing some kind of automatic flattening function?
>
> i.e., today can you do:
> "select employees from Department" (returns cells of type Collection)?
>
> Perhaps I'm confusing the issue.
>
> Wes
>
> erik@jpox.org wrote:
>
> >Thanks Craig.
> >
> >If a map is projected, do we have two cells (key, value) or one cell with
> type
> >Map.Entry ?
> >
> >I would expect it to be Map.Entry, what is in the spec?
> >
> >
> >
>
>




Mime
View raw message