public Query createSQLQuery(String sql, String returnAlias, Class returnClass)
Create a new instance of Query for the given SQL string.
Parameters: sql - a query expressed in SQL returnAlias - a table alias that appears inside {} in the SQL string returnClass - the returned persistent class 2.然后我将hibernate的参考文档第13章的例子画了张图。 看完该图,应该能够理解了吧??!?2.现在,可以继续阅读hibernate的参考文档第13章(hibernate\doc\reference\zh-cn\html\querysql.html),他描述的完整的概念--除了我画的图 :D。3.相关API: Session.createSQLQuery(String sql, String[] returnAliases, Class[] returnClasses)当你使用多表查询时,使用Session接口的这个apicreateSQLQuery
public Query createSQLQuery(String sql, String[] returnAliases, Class[] returnClasses)
Create a new instance of Query for the given SQL string.
Parameters: sql - a query expressed in SQL returnAliases - an array of table aliases that appear inside {} in the SQL string returnClasses - the returned persistent classes 4.其他 4.1不要查询未映射的表或视图。
文章来源于领测软件测试网 https://www.ltesting.net/










