Skip to content

Allow repositories to work with interfaces as domain type [DATAMONGO-131] #1067

@spring-projects-issues

Description

@spring-projects-issues

Oliver Drotbohm opened DATAMONGO-131 and commented

With the fix for issue DATAMONGO-128 we allow persisting inheritance structures with repositories. Unfortunately executing findOne(…) uses MongoEntityInformation to lookup the id property to pipe it into the query. This id property is discovered from the domain class the repository manages. This implies that this type carries the id property which doesn't have to be the case (it actually can't be the case for interfaces as managed root type).

So we should use the MongoTemplate's MappingContext instead to ask it for the entity meta information of the given object instead of the type managed by the repo


Affects: 1.0 M2

9 votes, 9 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions