# ElasticSearch with Java API - Mapping a complicated class with from a class or existing object

**URL:** <https://discuss.elastic.co/t/elasticsearch-with-java-api-mapping-a-complicated-class-with-from-a-class-or-existing-object/164954>\
**Category:** Elasticsearch\
**Created:** [January 20, 2019, 6:22pm UTC](https://discuss.elastic.co/t/elasticsearch-with-java-api-mapping-a-complicated-class-with-from-a-class-or-existing-object/164954 "2019-01-20T18:22:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zalman\_Goldstein](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zalman_goldstein/32/39989_2.png) [@Zalman\_Goldstein](https://discuss.elastic.co/u/Zalman_Goldstein)\
**Post date:** [January 20, 2019, 6:22pm UTC](https://discuss.elastic.co/t/elasticsearch-with-java-api-mapping-a-complicated-class-with-from-a-class-or-existing-object/164954/1 "2019-01-20T18:22:03Z")

</div>

My class - "Transaction", is complicated with a lot of nested objects. There is a way to define the mapping straight from the class or an existing object?

note: I am using the rest API with High-Level client. if there is only a solution with the low-level client, ist also ok.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 17, 2019, 6:22pm UTC](https://discuss.elastic.co/t/elasticsearch-with-java-api-mapping-a-complicated-class-with-from-a-class-or-existing-object/164954/2 "2019-02-17T18:22:23Z")

</div>

Closed on February 17, 2019, 6:22pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
