Can someone tell me, why this is not working:
criteria.add(cb.like((myentity.get(\"integerid\")).as(String.class), \"2%\"))
I have faced the same issue. I use JPA2.0 and EclipseLink 2.3 as implementation.
The column codeClient is actually an Integer in my DataBase.
The annotation @Convert simply convert my Integer column to a String column.
In that way i can use a like predicate over numbers.
@Entity
@Table(name="COLIS_SO_VM")
public class Colis implements Serializable {
...
@Convert
private String codeClient;
...
}
I know this is an old post but if it can help someone else !