MongodbSerializer does not support Ops.CONTAINS_KEY #291

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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Nov 20, 2012

Member

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

Member

timowest commented Nov 20, 2012

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

@mnshdw

This comment has been minimized.

Show comment
Hide comment
@mnshdw

mnshdw 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.

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Nov 21, 2012

Member

Implemented as suggested

Member

timowest commented Nov 21, 2012

Implemented as suggested

@mnshdw

This comment has been minimized.

Show comment
Hide comment
@mnshdw

mnshdw Nov 21, 2012

Thanks !

mnshdw commented Nov 21, 2012

Thanks !

@mnshdw mnshdw closed this Nov 21, 2012

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Nov 21, 2012

Member

I'll close it when it's released

Member

timowest commented Nov 21, 2012

I'll close it when it's released

@timowest timowest reopened this Nov 21, 2012

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 13, 2013

Member

Released in 3.0.0.BETA1

Member

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