Thursday, July 16, 2015

Ormlite single quote issue solution

Correct way to implement com.j256.ormlite.stmt.Where<T, ID>:

you should use com.j256.ormlite.stmt.SelectArg object instead of using Object
SelectArg arg = new SelectArg();
Where<T, ID> where = where.eq(fieldName, arg);

Using this way you will avoid this issue i.e. if  String value contains single quote.

1 comment:

  1. Also, they are easy to move owing to their lightweight property and thin design. Moreover, they are versatile to be used in numerous weather conditions on account of their capacity to withstand corrosion and moisture. They provide various precision machining different advantages too, such as, easy availability worldwide, recyclability, and durability. The use of lightweight materials and alloys with titanium and aluminum is more likely to|prone to} contribute to the expansion of the sector. It is alloyed with iron, aluminum, manganese, and different metals to improve bodily and chemical properties.