title: Apache Camel JPA: Using the output attribute of one entity to query another entity
body: <p>I am trying to use camel-jpa component with the hibernate provider and Named queries. It works great with a small caveat...</p>
  
  <p>I have an event queue table which is logs state changes to different entity objects like incident, request, change in a normalized fashion and is populated by database triggers</p>
  
  <p>The event queue table will have columns like
  event_id,occurance_time,entity_type,entity_id,operation, and other status flags </p>
  
  <p>where entity types is like 
  entity_type: incident, change, request etc...
  operation: create, update, delete, comment etc..</p>
  
  <p>I initially created an event entity which performed JoinColumn on a subset of the entities like incident, request which works great since Incidents and request objects
  reside in the same table. However it would not work since Change and other Objects and other entities reside in other tables.</p>
  
  <p>I am planning to fetch the stub record from the event_queue as is without using joins and using camel-jpa and then use a "choice" operator and subsequent jpa queries depending on the entity type and id.</p>
  
  <p>Please assist on how this can be done with the camel-jpa component since the entity_id would need to be passed to the query based on the outcome of the first jpa: operation. </p>
  
  <p>I have looked at a similar question asked on Stack Overflow "Apache Camel JPA: read from multiple tables" where he uses bean but I would like to use a more elegant way to solve the problem</p>