Skip to Content
0
Sep 02, 2019 at 08:57 PM

Facing below issue in Flexible search

482 Views Last edit Sep 04, 2019 at 07:21 AM 2 rev

My code :

private static final String Query_EmailAddress_From_B2BUnit = "SELECT {" + DNSB2BUnitPreferencesModel.EMAILADDRESS + "}" + " FROM {" + DNSB2BUnitPreferencesModel._TYPECODE + "}" + " WHERE {" + DNSB2BUnitPreferencesModel.B2BUNIT + "}=?b2bUnit";



@Override public String getEmailAddressesForB2BUnit(final B2BUnitModel b2bUnit) { final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(Query_EmailAddress_From_B2BUnit); fQuery.addQueryParameter("b2bUnit", b2bUnit); final SearchResult<String> result = flexibleSearchService.search(fQuery); final String emailAddressesList = result.getResult().get(0); return emailAddressesList; }

It is giving me search failure because of : Caused by: de.hybris.platform.jalo.flexiblesearch.FlexibleSearchException: SQL search error - Fail to convert to internal representation query = 'SELECT item_t0.p_emailaddress FROM dnsb2bunitpreferences item_t0 WHERE ( item_t0.p_b2bunit =?) AND (item_t0.TypePkString=? )', values = [8806611648517, 8796156788818]

Though in HAC below query is running : select {emailAddress} from {DNSB2BUnitPreferences} where {b2bUnit}='8806611648517'

No idea why it is failing for me , i see no mismatch of types as well

NOTE: Using oracle DB.