I\'m working with PostgreSQL query implementing in JPQL.
This is a sample native psql query which works fine,
SELECT * FROM students ORDER BY id DESC
You can use something like this:
@Repository public interface ICustomerMasterRepository extends CrudRepository { @Query(value = "SELECT max(c.customer_id) FROM CustomerMaster c ") public String getMaxId(); }