like this:
public interface XXXRepository extends CrudRepository { @Query(value = \"select * from ?1 where ...\", nativeQuery = true) Lis
You can use entitymanger in jpa project.
@Autowired EntityManager entityManager;
entityManager.createNativeQuery("select * from "+tableName+"")