Skip to content

GPMONGODB-24: CLONE -Dynamic finders returning multiple objects are not wrapped as domain objects #291

@graemerocher

Description

@graemerocher

Original Reporter: nugsie
Environment: MongoDB Plugin 1.0-M4, Grails 1.3.7, Java 1.6, Linux (Ubuntu 10)
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPMONGODB-24

When using list() or findAll*() methods, the plugin returns lists of named BasicDBObjects. This is inconsistent with the behaviour of the finders returning single objects which correctly return wrapped domain object instances.

This means 2 crucial things:

  1. instanceOf() method isn't bound and any comparison to other domain objects (ie ones that haven't been returned as BasicDBObjects) will return false

  2. The id property will not be correctly mapped as the underlying implementation is _id so it's not exposed in the BasicDBObject as 'id'

Whilst other properties are correct so for the most part it can feel as if things are functioning normally this is quite a problem.

Test case app attached to demonstrate the problem both with list() and findAll*() along with a proof that general single finders are working ok.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions