So here is the scenario, I have 3 beacons (BEACON_TABLE) and some products (PRODUCT_TABLE) where each product is associated with one of the beacon (one to many relationship). The data model is working fine with SQL where, I just use a foreign key in my PRODUCT_TABLE to reference a particular beacon id from BEACON_TABLE. I did that in the Entity store (Full stack / no wrapper), where I added a property to the PRODUCT_TABLE and set Reference typed to BEACON_TABLE. When I run the GET method on the BEACON_TABLE resource, it just displays the beacon data, but I was expecting all the products associated with the beacon with the response. A JSON response something like this:
[
{"beacon_id":"beacon1", "products": [
{"id":"prod1","price":"1.50"},
{"id":"prod2","price":"2.50"}
]
},
{"beacon_id":"beacon2", "products": [
{"id":"prod30","price":"3.95"},
{"id":"prod40","price":"5.15"}
]
}
]
How can I achieve it in the Entity Store? I went through the user guide with the user-comment scenario which was pretty unclear to me. Some help will be highly appreciated.