How to get the SQL String From JPQLQuery
问题 I'm using EclipseLink. I've a JPQLquery and I want to get the sql String.. Now I'm doing in this way: EJBQueryImpl qi = (EJBQueryImpl)jpqlQuery; String sqlQueryString = qi.getDatabaseQuery().getSQLString(); The problem is that in the sqlQueryString the constant are replaced with ? I've tried to get the values navigating the expressions trees ( getSelectionCriteria() and getHavingCriteria() ) but in this way I loose the type... Do any one ever have a problem like this one? 回答1: Quoted from the