[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2474) Hibernate doesn't support parameterized queries if the parameter is used before the where clause

SK (JIRA) noreply at atlassian.com
Wed Mar 7 06:01:31 EST 2007


Hibernate doesn't support parameterized queries if the parameter is used before the where clause
------------------------------------------------------------------------------------------------

         Key: HHH-2474
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2474
     Project: Hibernate3
        Type: Improvement

  Components: query-hql, query-sql  
    Versions: 3.2.2    
 Environment: 3.2.2, Oracle 9
    Reporter: SK


This works in JDBC

		PreparedStatement st = con.prepareStatement("select TRUNC(sysdate, ?) from dual");
		st.setString(1, "MM");
		ResultSet rs = st.executeQuery();


A similar query doesn't work with Hibernate at present if the parameter is before the WHERE clause

session.createSQLQuery("select TRUNC(sysdate,:truncFormat) from dual").setParameter("truncFormat", "MM").list();

fails




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list