Can someone tell me, why this is not working:
criteria.add(cb.like((myentity.get(\"integerid\")).as(String.class), \"2%\"))
JPA does not support like() with Integers, only Strings. Some databases do support like with integer and others do not.
EclipseLink should allow usage of like() with Integer (provided your database supports it). What version are you using? May need to use >= 2.1. If it fails on the latest version, then please log a bug.
You can also convert the integer to a string using a "CHAR, "TO_CHAR" or "CONVERT" function depending on your database. The criteria API supports a function() API to call a native function.
Note that the as() API is not intended for converting from Integer to String, it is for casting to a subclass entity.