<many-to-one name="member" class="com.common.hibernate.member.Member" fetch="select">
<column name="author" length="10" not-null="true" />
</many-to-one>
HQL:
select member from A表 as model
报错:
javax.servlet.ServletException: unexpected token: member
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
root cause
line 1:8: unexpected token: member
org.hibernate.hql.antlr.HqlBaseParser.selectClause(HqlBaseParser.java:1330)
org.hibernate.hql.antlr.HqlBaseParser.selectFrom(HqlBaseParser.java:1106)
org.hibernate.hql.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:702)
org.hibernate.hql.antlr.HqlBaseParser.selectStatement(HqlBaseParser.java:296)
org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:159)
org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:238)
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155)
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
4 个解决方案
#2
接分先!
#3
等待牛人来答.
#4
#1
这有一个我的文档,你去看一下,可能对你有所帮助呢:
http://blog.csdn.net/loaferwang/archive/2008/03/20/2198666.aspx
http://blog.csdn.net/loaferwang/archive/2008/03/20/2198666.aspx
#2
接分先!
#3
等待牛人来答.