title: generic java structure to store multiple object types and keys defined
body: <p>I am looking to see whats out there in collections in any java framework like apache or guava that will let me handle the below. I am also open to consider any custom implementations if required</p>
  
  <p>Basically I have </p>
  
  <ol>
  <li>Inventory object , the inventory number field will help identify a
  unique inventory object  </li>
  <li>Order object the order number field will
  help identify a unique order  </li>
  <li>OrderItem Object, the order number and
  item number fields will help identify a unique order (the key here
  is composite)</li>
  </ol>
  
  <p>I can have more objects come in later on with different attributes and having composite key types. Also I dont want to put the orderItem inside the order object</p>
  
  <p>Basically I am looking to see if there is a elegant way to build a generic structure where in I can define the keys that will help identify a object and retrieve the object dynamically using the key? I should be able to specify composite key types as well. </p>
  
  <p>structure.put(invKey, inventory);
  structure.put(orderKey, order);
  structure.put(orderItemKey, orderItem) (the key here is composite of two attributes)</p>