title: QueryDSL: How to set-up CaseBuilder to return columns instead of constant expressions
body: <p>I want to setup a SQL case expression via the JPASQLQuery API as follows:<br>
  The Oracle SQL is:  </p>
  
  <pre class="lang-sql prettyprint-override"><code>    SELECT h.ordercode
    , h.requesteddeliverytime
    , CASE
          WHEN h.ordergroup IS NOT NULL
          THEN g.minRequestedDeliveryTime
          ELSE h.requesteddeliverytime
      END AS earliest_del_time
     FROM orderheader h LEFT JOIN (
                             SELECT 
                              ordergroup
                             ,MIN(requesteddeliverytime) as minRequestedDeliveryTime
                            FROM orderheader hh
                           GROUP BY orderGroup   
                   ) g ON h.ordergroup = g.ordergroup
  </code></pre>
  
  <p>and delivers the correct results. When I try to setup a CaseBuilder(), I get back a simple <code>Expression</code>, which then can't be used in a JPASQLQuery anymore (at least I'm not able to set an alias with <code>.as("someString")</code>).</p>
  
  <p>The metadata class looks as follows (short form):  </p>
  
  <pre class="lang-java prettyprint-override"><code>    @Generated("com.mysema.query.sql.codegen.MetaDataSerializer")
  public class SOrderheader extends com.mysema.query.sql.RelationalPathBase&lt;SOrderheader&gt; {
  
      public final StringPath ordergroup = createString("ORDERGROUP");
      public final DateTimePath&lt;java.sql.Timestamp&gt; requesteddeliverytime = createDateTime("REQUESTEDDELIVERYTIME", java.sql.Timestamp.class);
  }
  </code></pre>
  
  <p>and the group query looks as follows:  </p>
  
  <pre class="lang-java prettyprint-override"><code>    ListSubQuery&lt;Tuple&gt; groupSubQuery = new SQLSubQuery()
          .from(sOrderGroup)
          .groupBy(sOrderGroup.ordergroup)
          .list(new QTuple(
                  sOrderGroup.ordergroup.as("orderGroup"),
                  sOrderGroup.id.count().as("nofOrdersPerGroup"),
                  sOrderGroup.requesteddeliverytime.min().as("earliestDeliveryTime"),
                  ));
  </code></pre>
  
  <p>CaseBuilder() statement:  </p>
  
  <pre class="lang-java prettyprint-override"><code>        Expression&lt;Timestamp&gt; earliestDeliveryTime = new CaseBuilder() 
              .when(sOrderHeader.ordergroup.isNotNull()).then(og.getDate("earliestDeliveryTime", Date.class)) 
              .otherwise(sOrderHeader.requesteddeliverytime);
  </code></pre>
  
  <p>I'd like to have some means to return different columns in the various CASE alternatives and / or the possibility to set aliases on the expressions returned from the CaseBuilder(). Any help is appreciated. </p>