SpringSource/spring-data-elasticsearch — pull request #9 by stuartstevenson (2013-08-25 18:32:24+00:00)
Title: MappingBuilder circular reference issue

I found that by trying to save a spatial4j PointImpl object using a repositories save method that MappingBuilder threw a StackOverFlow error because PointImpl contains a circular reference to a field Point class called 'center'.

Looking deeper I noticed mapEntity method recursively calls itself and has no way to avoid infinite loops. Committed a test with dummy object CircularObject that contains a reference to itself as a field.

My solution was to add a property on the Field annotation with the idea that users can specify the fields that should be ignored when mapping the object and its children.