Using Hibernate query : colon gets treated as parameter / escaping colon

前端 未结 6 1311
陌清茗
陌清茗 2020-12-05 18:00
return sessionFactory.getCurrentSession().
            createQuery(\"FROM Weather WHERE city_id = :id AND date \" +
                    \"BETWEEN now()::date AND now         


        
6条回答
  •  无人及你
    2020-12-05 18:59

    Take a look at http://www.postgresql.org/docs/8.1/static/sql-createcast.html

    Try using cast. To me it worked like a charm.

提交回复
热议问题