String hql=" select new Map(o.id as id,o.entname as entname, o.tel as tel , d.nr as djjg ) from DataQyfrEntity o LEFT JOIN ABmDjjgEntity d with (d.bm=o.djjg) ";
017-03-21 08:44:47,178 ERROR (org.hibernate.hql.PARSER:56) - Path expected for join! 2017-03-21 08:44:47,184 ERROR (org.hibernate.hql.PARSER:56) - Invalid path: 'd.nr' 2017-03-21 08:44:47,184 ERROR (org.hibernate.hql.PARSER:56) - <AST>:0:0: unexpected end of subtree 2017-03-21 08:44:47,203 WARN (WARN:185) - Handler execution resulted in exception java.lang.NullPointerException at org.hibernate.hql.ast.HqlSqlWalker.setAlias(HqlSqlWalker.java:993) at org.hibernate.hql.antlr.HqlSqlBaseWalker.aliasedSelectExpr(HqlSqlBaseWalker.java:2243) at org.hibernate.hql.antlr.HqlSqlBaseWalker.constructor(HqlSqlBaseWalker.java:2421) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:2118) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1983) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1515) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:586) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:294) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:237) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1760)
我用的是hibernate spring mvc freemarker, hibernate是注解映射的