Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProjectableQuery & its subclasses should implement equals & hashCode #167

Closed
matthewadams opened this issue Jun 7, 2012 · 5 comments
Closed

Comments

@matthewadams
Copy link
Contributor

@matthewadams matthewadams commented Jun 7, 2012

It appears (in QueryDSL <= 2.5.0) that JPAQuery & its superclasses don't implement equals(Object) & hashCode(). This would be useful when using detached JPAQuery instances in a query cache, something like a Map<JPAQuery,?>, where the value could be of any query result type.

This is related to issue #152.

@timowest
Copy link
Member

@timowest timowest commented Jun 7, 2012

I guess the identity could be defined mostly by the included QueryMetadata instance?

@matthewadams
Copy link
Contributor Author

@matthewadams matthewadams commented Jun 7, 2012

Yes, mostly.

@timowest
Copy link
Member

@timowest timowest commented Jun 7, 2012

What's the idea of the query cache? Could you elaborate?

@matthewadams
Copy link
Contributor Author

@matthewadams matthewadams commented Jun 7, 2012

The legacy code I'm working on checks a map of previously issued queries
(the cache) to see if that call has already been issued. If it has, then
there will be an entry for that query and that entry's value is returned
and the query is not executed again. If not, then the query is executed,
its results are stored in the map keyed on the query, and then the results
are returned.

The legacy code uses custom query descriptors to describe the queries and
uses those as map keys. I'm looking to replace the custom query descriptor
map keys with Predicate and/or JPAQuery instances.

On Thu, Jun 7, 2012 at 3:11 PM, Timo Westkämper <
reply@reply.github.com

wrote:

What's the idea of the query cache? Could you elaborate?


Reply to this email directly or view it on GitHub:
#167 (comment)

mailto:matthew@matthewadams.me matthew@matthewadams.me
skype:matthewadams12
googletalk:matthew@matthewadams.me
http://matthewadams.me
http://www.linkedin.com/in/matthewadams

@timowest
Copy link
Member

@timowest timowest commented Jun 28, 2012

Released in 2.7.0

@timowest timowest closed this Jun 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants