hello,

I am using Cayenne 2.0.4 in a standalone application with Derby embedded.

The following code breaks for obvious reasons when there is an apostrophe ("'") in the person's name.

---------

SQLTemplate template = new SQLTemplate(Person.class, "SELECT * FROM people where country_id=" + String.valueOf(country.getId()) + " and name='" + name + "'");

List res = dataContext().performQuery(template);
---------

What is the best (Cayenne specific or otherwise) approach to dealing with this problem?

Thanks

Reply via email to