cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid value getLong() when executing flexible search query from code

Former Member

Hi, I am having a problem with a simple query, it executes successfully in the hybris console but fails from code, with Invalid value getLong() error.

SELECT DISTINCT {p.name} FROM {Publication! AS p} ORDER BY {p.name} ASC

Invalid value for getLong() - 'Beeld' query = 'SELECT DISTINCT lp_t0.p_name FROM publicationlp lp_t0 WHERE ((lp_t0.LANGPK =? )) AND (lp_t0.ITEMTYPEPK=? ) order by lp_t0.p_name ASC', values = [8796093055008, 8796098396242]] with root cause java.sql.SQLException: Invalid value for getLong() - 'Beeld' at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)

View Entire Topic
Former Member

Well you are returning non hybris model in your flexi query & by default the flexisearch query always trys to cast the return to PK of hybris item

if you really want to return non hybris item type in flexi search query then you need to set the return data types as below….
FlexibleSearchQuery.setResultClassList(resultClassList);