You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DATAES-562 introduced the name attribute for the @Field annotation; this is used by the ElasticsearchEntityMapper to map the Java objects property to the field name used in Elasticsearch. This works for auto-type fields fields on storing when a default mapping for this field is created, but not for the definition of the mapping when the MappingBuilder ist used.
The MappingBuilder must be changed to honor this annotation together with the other attributes of the @Field annotation
Affects: 3.2 M3 (Moore)
Issue Links:
DATAES-20 Allow @Field Annotation to be used on setter methods
("supersedes")
I had a look at the MappingBuilder today, and it is no big deal to add the @Field's annotation value as the fieldname for the mapping. But personally I don't like that the MappingBuilder - which is just a collection of static methods - does it's own reflection on the class to be mapped to get to the fields and the annotations when we already have the metadata information in the corresponding ElasticsearchPersistentEntity object in the Elasticsearch(Rest)Template classes that call the mapping method.
I would prefer to have a new MappingBuilder class that uses this metadata to create a mapping - or rewrite the existing class, as it is package private and only used by the tests and template classes.
I think it's fine to replace the existing as long as we manage to keep its behavior and just extend it to cover additional functionality. For non public API we can do this even more aggressively since we don't neet to worry about changing method signatures
sothawo opened DATAES-568 and commented
DATAES-562 introduced the
name
attribute for the@Field
annotation; this is used by theElasticsearchEntityMapper
to map the Java objects property to the field name used in Elasticsearch. This works for auto-type fields fields on storing when a default mapping for this field is created, but not for the definition of the mapping when theMappingBuilder
ist used.The
MappingBuilder
must be changed to honor this annotation together with the other attributes of the@Field
annotationAffects: 3.2 M3 (Moore)
Issue Links:
@Field
Annotation to be used on setter methods("supersedes")
Referenced from: pull request #281
The text was updated successfully, but these errors were encountered: