[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5410) Ability to get the equivalent sql from HQL or Criteria query with final parameter values of complex Hibernate Custom Type

radhakrishna (JIRA) noreply at atlassian.com
Sun Jul 25 19:42:36 EDT 2010


Ability to get the equivalent sql from HQL or Criteria query with final parameter values of complex Hibernate Custom Type
-------------------------------------------------------------------------------------------------------------------------

                 Key: HHH-5410
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5410
             Project: Hibernate Core
          Issue Type: New Feature
            Reporter: radhakrishna


Ability to get sql from HQL/Criteria queries and final sql parameter values injected into positional parameters, instead of a prepared statement.

Hibernate Tools displays sql as when we type the HQL (fails for criteria queries), but there is no way to access them NOT AS prepared statements to debug it.

HQL: "from Entity where prop1 = '1' and prop2 = 2"

CRITERIA: session.createCriteria(Entity.class)
.add(Restrictions.eq("prop1",'1'))
.add(Restrictions.eq("prop2",2))

These two are not the same, because the criteria query executes it as a prepared statement or is there a way to inject constant parameters like the above HQL using criteria queries? How do we force the HQL or criteria to not execute it as a prepared statement or return the equivalent SQL?

The sql is usesful in customizing such as in case of "union" queries.

-- 
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