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

MongodbSerializer does not support Ops.CONTAINS_KEY #291

Closed
mnshdw opened this issue Nov 20, 2012 · 6 comments
Closed

MongodbSerializer does not support Ops.CONTAINS_KEY #291

mnshdw opened this issue Nov 20, 2012 · 6 comments
Milestone

Comments

@mnshdw
Copy link

@mnshdw mnshdw commented Nov 20, 2012

Version 2.9.0.

The MongodbSerializer class does not support Ops.CONTAINS_KEY which is used by MapExpressionBase when calling containsKey.

Ex:
QObject.object.someMap.containsKey(someMapKey);

See attached trace :
java.lang.UnsupportedOperationException: Illegal operation containsKey(#actual data removed#)
at com.mysema.query.mongodb.MongodbSerializer.visit(MongodbSerializer.java:204)
at com.mysema.query.mongodb.MongodbSerializer.visit(MongodbSerializer.java:34)
at com.mysema.query.types.expr.BooleanOperation.accept(BooleanOperation.java:53)
at com.mysema.query.mongodb.MongodbSerializer.handle(MongodbSerializer.java:39)
at com.mysema.query.mongodb.MongodbQuery.createQuery(MongodbQuery.java:362)
at com.mysema.query.mongodb.MongodbQuery.count(MongodbQuery.java:349)

@timowest
Copy link
Member

@timowest timowest commented Nov 20, 2012

How should we support it? Do you have something in mind?

@mnshdw
Copy link
Author

@mnshdw mnshdw commented Nov 21, 2012

Basically either in Java or in MongoDB "containsKey" is a user friendly substitute for checking whether a map key is null.

Currently :

  • QObject.object.someMap.containsKey(someMapKey) => not supported
  • QObject.object.someMap.get(someMapKey).isNotNull() => works

I suggest using the same code for both.

timowest added a commit that referenced this issue Nov 21, 2012
@timowest
Copy link
Member

@timowest timowest commented Nov 21, 2012

Implemented as suggested

@mnshdw
Copy link
Author

@mnshdw mnshdw commented Nov 21, 2012

Thanks !

@mnshdw mnshdw closed this Nov 21, 2012
@timowest
Copy link
Member

@timowest timowest commented Nov 21, 2012

I'll close it when it's released

@timowest timowest reopened this Nov 21, 2012
@timowest
Copy link
Member

@timowest timowest commented Jan 13, 2013

Released in 3.0.0.BETA1

@timowest timowest closed this Jan 13, 2013
@timowest timowest added this to the 3.0.0 milestone Apr 14, 2014
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