Database independent string comparison with JPA

后端 未结 3 2017
攒了一身酷
攒了一身酷 2021-01-19 04:17

I\'m working with JPA (Hibernate as provider) and an underlying MySQL database.

I have a table containing every name of streets in Germany. Every streetname has a un

3条回答
  •  无人共我
    2021-01-19 04:47

    You also write a SQL query. It is like a normal query:

    Query sqlQuery = session.createSqlQuery("select * from CITY where name like binary :name').addString('name', name);
    

    Note that the code is roughly done.

提交回复
热议问题