It is possible to set column name (or table name) as parameter in JPA, like :
Query query = em.createNativeQuery( "select ? , ? from ?"); query.setParameter(1, title); query.setParameter(2, value); query.setParameter(3, tableName); I got an SQL exception when running such code !! This code is used to get data from tables generated at runtime. It and do it with String concatenation, but what about setting parameters on query?