java - JPA Criteria "locate" ignoring "from" parameter -


i have table sasdossiers 1 column apentrytext has 1 value 6.8.3 dossiers "a" , sas, fürsorgeleistungen auslandschweizer need select after last ,: fürsorgeleistungen auslandschweizer. if perform following query in sql, select correct:

select distinct trim(substr(apentrytext,instr(apentrytext,',',-1)+1)) sasdossiers; 

whereas, if try use equivalent in jpa critera

cq.multiselect(             cb.trim(                     cb.substring(                             sasdossier.get(sasdossier_.apentrytext),                             cb.sum(                                     cb.locate(sasdossier.get(sasdossier_.apentrytext), cb.literal(","), cb.literal(integer.valueof(-1))),                                     1                             )                     )             )     ).distinct(true); 

it ignores totally put in parameter (i have tried many different values, eg:-2, -100, 1, 2, 100) , seems ignore put there, result same. moreover, query generated hibernate shows argument is, indeed, ignored:

select distinct trim(both substr(sasdossier0_.apentrytext, instr(sasdossier0_.apentrytext, ?) + 1)) col_0_0_ access_db.sasdossiers sasdossier0_ sasdossier0_.apentrytext not null 

it seems legit bug, cuouldn't find has same error before, so, doing wrong? should report error?

thank you.


Comments