Trying to fetch data with this method in my repo and put into object:
@Modifying
@Query(value="select new com.mycompany.entity.User(ID, NAME, SURNAME) FROM UTF.do.[USERSTB] WHERE EML_NO = :emlNumber", nativeQuery = true)
List<EmlInfoEntity> findByEMLNumber(@Param("emlNumber") Integer emlNumber);
And I get this error:
Caused by: com.sybase.jdbc4.jdbc.SybSQLException: SQL function not found. If you are attempting to call a java UDF, Java services are not enabled.
at com.sybase.jdbc4.tds.Tds.processEed(Tds.java:4117)
at com.sybase.jdbc4.tds.Tds.nextResult(Tds.java:3207)
at com.sybase.jdbc4.jdbc.ResultGetter.nextResult(ResultGetter.java:78)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:291)
at com.sybase.jdbc4.jdbc.SybStatement.nextResult(SybStatement.java:273)
at com.sybase.jdbc4.jdbc.SybStatement.queryLoop(SybStatement.java:2410)
at com.sybase.jdbc4.jdbc.SybStatement.executeQuery(SybStatement.java:2396)
at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeQuery(SybPreparedStatement.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
at com.sun.proxy.$Proxy180.executeQuery(Unknown Source)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
... 113 more
I need it to return the User object:
[
{
"id": 1,
"name": "tommy",
"surname": "lens"
}
]