How to escape colon `:` within a native SQL query in Hibernate?

前端 未结 2 1871
再見小時候
再見小時候 2021-01-12 02:12

I have a native SQL query that looks like that :

Query query = session.createSQLQuery(\"SELECT
        XMLSERIALIZE
        (CONTENT
          XMLELEMENT
           


        
2条回答
  •  不知归路
    2021-01-12 02:41

    If your colon is a cast like SELECT reltuples::BIGINT then you can rewrite it as a cast(reltuples as BIGINT) to avoid the colons.

    ref

提交回复
热议问题