0

I am trying to get a distinct list of one particular column.
Somehow or the other, I am just not getting what I expect back... Here is the query that I am trying...

@NamedQuery(name="getDstResourceIDsByOrgIDs", query="SELECT DISTINCT d.resourceId FROM DistListPermission d WHERE d.organizationId in ?1")

Now if I am not correct, should that return a distinct list of resourceID's where the organizationID is in a list of organizationID's. Right now this is the result I get...

org.apache.openjpa.kernel.DistinctResultList@191f191f

I mean, what on earth is that???

4

1 回答 1

2

It is immutable list of unique elements that is used by OpenJPA to provide result from such a query. It implements java.util.List, so there is no problem. Actual implementation of list does not matter, as long as elements are of correct type.

If you iterate over this list, you will likely see expected distinct values of resourceId.

于 2012-07-16T18:05:40.377 回答