title: Hibernate count from multi tables
body: <p>I would like to write a single HQL query that return a specific count from 4 tables in different columns.</p>
  
  <p>I have 4 tables: <code>Tab1</code>, <code>Tab2</code>, <code>Tab3</code> and <code>Tab4</code>, and I would like to get something like this:</p>
  
  <pre><code>|Tab1   | Tab2  | Tab3  | Tab4   |
  |..1....|..13...|...7...|....0...|
  </code></pre>
  
  <p>All records in <code>Tab#</code>s have their own <code>id</code> and <code>ObjectID</code> and <code>ObjectFetch</code>columns</p>
  
  <p>I have tried something like this:</p>
  
  <pre><code>select DISTINCT
  (select count(*) from Tab1 where ObjectFetch=:fetch and ObjectID=:id),
  (select count(*) from Tab2 where ObjectFetch=:fetch and ObjectID=:id),
  (select count(*) from Tab3 where ObjectFetch=:fetch and ObjectID=:id),
  (select count(*) from Tab4 where ObjectFetch=:fetch and ObjectID=:id),
  from Tab1, Tab2, Tab3, Tab4
  </code></pre>
  
  <p>But it doesn't work at all, any idea why?</p>