I am trying to run the below query in Hibernate Search and I am getting the below exception in the log. I am not sure what I am missing to make it work.
String hsql="SELECT * FROM (SELECT dest.ID,dest.postal_code AS ZIP, ACOS(SIN ( RADIANS( src.latitude) ) * SIN ( RADIANS ( dest.latitude )) + COS ( RADIANS ( src.latitude)) * COS ( RADIANS ( dest.latitude )) * COS ( RADIANS( src.longitude ) - RADIANS ( dest.longitude ))) * 3959 AS DISTANCE FROM post_codes dest CROSS JOIN post_codes src WHERE src.ID = ( SELECT ID FROM post_codes WHERE postal_code = :zipCode GROUP BY ID ) AND ( dest.ID <> src.ID OR dest.ID = src.ID )) HAVING DISTANCE <= :miles GROUP BY ID,ZIP,DISTANCE;ORDER BY DISTANCE";
org.hibernate.SQLQuery query = getSession().createSQLQuery(hsql);
query.setParameter("zipCode", 60195);
query.setParameter("miles", 5);
List list= query.list();
System.out.println("***************"+list.size());
Exception in the log
16:24:34,387 WARN [JDBCExceptionReporter] SQL Error: 911, SQLState: 22019
16:24:34,387 ERROR [JDBCExceptionReporter] ORA-00911: invalid character
16:24:34,409 ERROR [[spring]] Servlet.service() for servlet spring threw exception
java.sql.SQLSyntaxErrorException: ORA-00911: invalid character
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
Aucun commentaire:
Enregistrer un commentaire