cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simran Narula <>
Subject RE: How to turn on escaping for named queries
Date Mon, 14 May 2012 23:53:32 GMT
Thanks for the rely Andrus,

These are bunch of select queries like following:

<query name="getSomething" factory="" root="data-map"
<property name="cayenne.GenericSelectQuery.fetchingDataRows" value="true"/>
	Select something from table where value = '${valueFromParameterInJava}'

Following Is what I am doing in Java..

// create new map parameters... and insert key value pairs... 
NamedQuery query = new NamedQuery("getSomething", parameters);
List resultMaps = getDataContext().performQuery(query);
List<MyEntity> results = new ArrayList<OrderBean>();


I am looking to escape single quotes only ( ' ) 


-----Original Message-----
From: Andrus Adamchik [] 
Sent: Monday, 14 May 2012 6:00 PM
Subject: Re: How to turn on escaping for named queries


You do not indicate what type of queries you have (SelectQuery, SQLTemplate, etc?) Also could
you give an example of what characters you'd like to escape? There is a good chance the answer
will be to escape it manually, but I was wondering about the use case.


On May 7, 2012, at 6:45 AM, Simran Narula wrote:
> Hi,
> I have a bunch of named queries in my
> And cayenne does not seems to be escaping the parameter values when these queries are
> Is there a way I can SWITCH ON escaping for these named queries in cayenne or is there
no way and I will have to manually escape the parameter values passed to these queries ??
> Thanks

View raw message