Skip to content

MappingMongoContext.shouldCreatePersistentEntityFor() does not consider simple types [DATAMONGO-1826] #2687

Open
@spring-projects-issues

Description

@spring-projects-issues

Mark Paluch opened DATAMONGO-1826 and commented

MappingMongoContext creates persistent entities for types which are considered to be simple ones. The actual issue occurs on encapsulated runtimes such as Java 9 where we attempt to introspect types with deep reflection. The memory consumed by superfluous entities is a less considerable aspect.

The effect of creating superfluous entities is not entirely a harm. It's also a feature which allows usage of the mapping context for types that have a custom converter registered. Preventing persistent entity creation would break existing functionality coming out of entity metadata (such as query mapping, determining a collection name).

We should investigate whether we can preserve that functionality to some degree while excluding unwanted typed from the mapping context. One approach could be opt-in using the @Document annotation or via the initial entity set


Affects: 2.0.1 (Kay SR1)

Issue Links:

  • DATAMONGO-1819 Discovering the preferred constructor lead to InaccessibleObjectException with Java 9

Metadata

Metadata

Assignees

Labels

in: mappingMapping and conversion infrastructuretype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions