Skip to content

ContextConfiguration class is package-private in SimpleElasticsearchPersistentEntity #2114

Closed
@mlyczek

Description

@mlyczek

In our project we are extending SimpleElasticsearchPersistentEntity to slightly modify the result of getIndexCoordinates() method to add our custom logic for automatically assigning prefix to index name. That's the only modification, we want to use the rest of SimpleElasticsearchPersistentEntity as it is.

But in #1788 a new inner class ContextConfiguration was added to SimpleElasticsearchPersistentEntity with package-private access, which was also added as a parameter to constructor. This means that SimpleElasticsearchPersistentEntity can't be extended outside of org.springframework.data.elasticsearch.core.mapping package despite the fact that SimpleElasticsearchPersistentEntity itself is public. That difference in access modifiers for class and its constructor parameter is a little bit misleading (and also broke our sub-class ;) )

I would like to ask if ContextConfiguration could be made also public? Looking into the code it holds only FieldNamingStrategy which is public and a boolean whether to save type hints into documents. Those are things that are set on mapping context and could be customised there anyway, so I think that it could be made public to allow extending and instantiation of SimpleElasticsearchPersistentEntity possible again outside of its package. Or were there some important reasons for ContextConfiguration being package-private?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions