Jul 14th, 2009, 12:56 PM
Issue with namedQuery string parameters
I have the following named query:
SELECT o FROM Organization o WHERE o.ooid = :ooid AND o.sor = :sor
This will not return anything:
Map<String, Object> namedParams = new HashMap<String, Object>();
But this will:
getJpaTemplate().find("SELECT new Organization(o.orgId, o.orgName) FROM Organization o where o.ooid='"+ooid+"' and o.sor='"+sor+"'");
What exactly decides that it is a String parameter and put the quotes around the parameter?
Jul 15th, 2009, 06:56 AM
Do you think this would have anything to do with the datasource configuration in websphere or with the Spring configuration of my entityManagerFactory or DAOs?
Any idea where I should look first?