title: QueryDSL build select count query
body: <p>I would like to build select count query by using QueryDSL library, something like this:</p>
  
  <p><code>select count(1) from table1</code></p>
  
  <p>I created next code:</p>
  
  <pre><code>SQLTemplates sqlTemplates = builder.printSchema().build();
  Configuration configuration = new Configuration(sqlTemplates);
  Path table = new RelationalPathBase(Object.class, "alias", "hr", "table1");
  StringPath[] columnsPath = new StringPath[1];
  columnsPath[0] = Expressions.stringPath(table, "field1");
  SQLQuery sqlQuery = new SQLQuery(dataSource.getConnection(), configuration)
                  .from(table);
  sqlQuery.setUseLiterals(true);
  String selectStatement = sqlQuery.getSQL(columnsPath).getSQL();
  </code></pre>
  
  <p>As result selectStatement is next: </p>
  
  <pre><code>select alias.field1 from hr.table1 alias
  </code></pre>
  
  <p>Could please someone advice how to rewrite code above to get</p>
  
  <pre><code>select count(alias.field1) from hr.table1 alias
  </code></pre>