I have two tables. One has a list of menu items, and the other is just a reference-table to keep track of which items go well with another item. Here's the table layout:
MenuItems CompMenuItems
----------- -------------
MenuItemID <------- MenuItemID <---- "Refers to MenuItemID"
Name ^--- CompMenuItemID <---- "Also refers to MenuItemID"
Since there is a many-to-many relationship between items, the following is entirely possible.
- Pepsi goes well with a Hamburger.
- Hamburger goes well with a Pepsi.
If I do this, though, when the JSON gets processed, it becomes an infinite loop of including each item in its complementary menu items array.
I'm using Spring MVC with Jersey\Jackson and Hibernate JPA, and I cannot solve this issue. Anyone ever see this particular problem?