We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
My domain classes are like:
@Entity class Arbitrary { String id Map<String,Object> data Geometry geometry static embedded = [ 'data', 'geometry' ] }
and
import grails.mongodb.geo.MultiPoint @Entity class Geometry { MultiPoint points }
Setting the arbitrary.data = null in controller works just fine, but arbitrary.geometry = null is ignored.
arbitrary.data = null
arbitrary.geometry = null
In order to dance the problem around, I defined a fake constant and the checker method in Geometry class, like so:
class Geometry { ... static final KINDA_NULL = new Geometry( points:MultiPoint.valueOf( [ [ 0, 0 ] ] ) ) boolean kindaNull() { points == KINDA_NULL.points } }
and added the interceptor into Arbitrary class like so:
class Arbitrary { ... def afterUpdate() { if( geometry.kindaNull() ) Arbitrary.collection.update( [ _id:getId() ], [ $unset:[ geometry:1 ] ] ) } }
Then it works kinda as expected.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
My domain classes are like:
and
Setting the
arbitrary.data = null
in controller works just fine, butarbitrary.geometry = null
is ignored.In order to dance the problem around, I defined a fake constant and the checker method in Geometry class, like so:
and added the interceptor into Arbitrary class like so:
Then it works kinda as expected.
The text was updated successfully, but these errors were encountered: