-
Jul 14th, 2009, 12:56 PM
#1
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>();
namedParams.put("ooid", ooid.trim());
namedParams.put("sor", sor.trim());
getJpaTemplate().findByNamedQueryAndNamedParams("" ,
params);
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
#2
Named Queries
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules