Reputation: 9737
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???
Upvotes: 0
Views: 2833
Reputation: 42074
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.
Upvotes: 2