我想用在春季查询, 一个表名,但是当我执行它,我得到这个以下错误:
春@Query删除报价
"could not extract ResultSet; SQL [n/a]; nested exception is
org.hibernate.exception.SQLGrammarException: could not extract ResultSet"
由于弹簧自动添加引号“的时候参数是一个字符串PARAM ..
@Query(value = "desc :name", nativeQuery = true)
List<RepositoryColumn> getColumnFromRepository(@Param("name") String name);
在其他情况下,我想"desc table_name"
而不是"desc 'table_Name'"
任何想法?
这与Spring没有任何关系,但参数替换如何与JDBC一起工作。这些查询不能使用参数绑定。 –
您可以创建一个程序,该程序将“执行即时”这个查询 –