title: Hibernate one class to many tables
body: <p>I'm wondering if there's a possibility to fetch multiple tables to only one java class
   for exemple :</p>
  
  <pre><code>TABLE LABELS;
  TABLE STANDARDS;
  TABLE REFERENCES;
  </code></pre>
  
  <p>mapped to the same class </p>
  
  <pre><code>public Class Information {
  
      private String type; // the type is the element who have to do the mapping =&gt; LABELS/STANDARDS/REFERENCES
      ...
  }
  </code></pre>
  
  <p>It's not possible for me to construct one class for each type for technical reason (I known that some heritage should be cool). </p>
  
  <p>Thank you</p>
  
  <p>Gilles</p>
  
  <p>EDIT :</p>
  
  <p>I'll try to expain a bit more :)</p>
  
  <p>I'm using a JMS service to get the informations. Each message have a particulary type, (in my exemples : "labels","standards" and "references").</p>
  
  <p>By using those type, I want to persit the informations in the respective Tables. The structure is exactly the same for every messages, it's why I wanna use a unique POJO.</p>
  
  <p>I hope it was better explain :)</p>
  
  <p>EDIT 2 : </p>
  
  <pre><code>TABLE LABELS (
      ID PRIMARY KEY AUTO_INCREMENT,
      MESSAGE VARCHAR(255),
      AUTHOR VARCHAR(255)
  );
  TABLE STANDARDS(
      ID PRIMARY KEY AUTO_INCREMENT,
      MESSAGE VARCHAR(255),
      AUTHOR VARCHAR(255)
  );
  TABLE REFERENCES (
      ID PRIMARY KEY AUTO_INCREMENT,
      MESSAGE VARCHAR(255),
      AUTHOR VARCHAR(255)
  );
  </code></pre>
  
  <p>and here's some examples of JMS</p>
  
  <pre><code>headers : 
      type : label
  body:
      {message:"name of the country",author:"john doe"}
  
  headers : 
      type : label
  body:
      {message:"nom du pays",author:"jenny doe"}
  
  headers : 
      type : reference
  body:
      {message:"country",author:"john doe"}
  </code></pre>
  
  <p>and I want to put them into the Information Class and persist them into the correct Table</p>