ProjectableQuery & its subclasses should implement equals & hashCode #167

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

Comments

Projects
None yet
2 participants
@matthewadams
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 7, 2012

Member

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

Member

timowest commented Jun 7, 2012

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

@matthewadams

This comment has been minimized.

Show comment
Hide comment
@matthewadams

matthewadams Jun 7, 2012

Contributor

Yes, mostly.

Contributor

matthewadams commented Jun 7, 2012

Yes, mostly.

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 7, 2012

Member

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

Member

timowest commented Jun 7, 2012

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

@matthewadams

This comment has been minimized.

Show comment
Hide comment
@matthewadams

matthewadams Jun 7, 2012

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 28, 2012

Member

Released in 2.7.0

Member

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