I\'m using Spring JPA and I need to have a native query. With that query, I need to get only two fields from the table, so I\'m trying to use Projections. It isn\'t working
The query should be using a constructor expression:
@Query("select new com.example.IdsOnly(t.id, t.otherId) from TestTable t where t.creationDate > ?1 and t.type in (?2)")
And i dont know Lombok, but make sure there is a constructor that takes the two IDs as parameters.