title: Eclipselink UNION + SELECT NEW
body: <p>I am using eclipselink 2.4.2. I have to do a query that uses a UNION and the SELECT NEW clause.</p>
  
  <p>My jpa query is like this:</p>
  
  <pre><code>SELECT new com.*.*.MyObject(s.field1, s.field2, s.field3) 
  FROM MyEntityBean1 s WHERE s.someField = :someField UNION SELECT 
  new com.*.*.MyObject(s.field1, s.field2, s.field3) 
  FROM MyEntityBean2 s WHERE s.someField = :someField UNION SELECT ...
  </code></pre>
  
  <p>but eclipselink transforms it in this sql query:</p>
  
  <pre><code>SELECT t0.COLUMN1, t0.COLUMN2, ... FROM 
  TABLE1 t1 WHERE (t1.COLUMN3 = ?) 
  UNION (SELECT  FROM TABLE2 t2 WHERE (t2.COLUMN3 = ?)) UNION (...)
  </code></pre>
  
  <p>As you can see the second select (and others) is empty so I receive this error:</p>
  
  <blockquote>
    <p>Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00936:
    missing expression</p>
  </blockquote>
  
  <p>I don't get this error if don't use SELECT NEW, but I need it because tables (and EntityBeans) that I use in the query have only some equal fields.</p>
  
  <p>Can any one tell me where it went wrong or if is it a bug?</p>