title: jpql constructor expression query org.postgresql.util.PSQLException
body: <p>i am using spring data jpa , i want to retrieve specific columns from postgres table, i followed couple of links to retrieve specific columns <a href="https://stackoverflow.com/questions/22007341/spring-jpa-selecting-specific-columns">Spring JPA selecting specific columns</a>
  i found regarding jpql constructor expression query to retrieve specific columns,</p>
  
  <p>i used the jpql expression on the respository class </p>
  
  <pre><code>public interface DeviceCrudRepository  extends CrudRepository&lt;Device,String&gt;{
  public Device findByBarcode(String barcode);
  
  @Query(value = "select new com.hello.world.model.Device (d.deviceName,d.deviceType,d.deviceDescription ,d.deviceRentalStatus) from devicedetails d where d.scancode=:scancode", nativeQuery = true)
  public Device findDeviceDetailsByBarcode(@Param("d.scancode") String d.scancode);
  </code></pre>
  
  <p>Model class is 
   i am using constructor too </p>
  
  <pre><code>public Device(String deviceName, String deviceType, String deviceDescription, String deviceRentalStatus) {
          super();
          this.deviceName = deviceName;
          this.deviceType = deviceType;
          this.deviceDescription = deviceDescription;
          this.deviceRentalStatus = deviceRentalStatus;
      }
  </code></pre>
  
  <p>I keep on getting exception </p>
  
  <p>org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
    Position: 15
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477) ~[postgresql-42.1.4.jar:42.1.4]
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190) ~[postgresql-42.1.4.jar:42.1.4]
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300) ~[postgresql-42.1.4.jar:42.1.4]
      at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428) ~[postgresql-42.1.4.jar:42.1.4]
      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354) ~[postgresql-42.1.4.jar:42.1.4]
      at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169) ~[postgresql-42.1.4.jar:42.1.4]
      at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:117) ~[postgresql-42.1.4.jar:42.1.4]</p>
  
  <p>when i checked in logs 
  the query which was generated was</p>
  
  <pre><code>select new com.hello.world.model.Device (d.deviceName,d.deviceType,d.deviceDescription ,d.deviceRentalStatus) from devicedetails d where d.scancode=?
  </code></pre>
  
  <p>it's  not able to translate the jpql expression into query,it's showing exception for package name, when i use the class name it's showing exception near the brackets, so i guess the jpql expression is not being translated 
  am i missing any dependency any help would be appreciated?</p>