[jboss-user] [EJB 3.0] - Re: RC9 mappedBy and InheritanceType.JOINED problem

NigelWhite do-not-reply at jboss.com
Wed Jun 13 05:34:51 EDT 2007


I hit this bug as soon as I upgraded to 3.2


  | Caused by: java.lang.NullPointerException
  | 	at org.hibernate.hql.ast.tree.FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements(FromClause.java:120)
  | 	at org.hibernate.hql.ast.tree.FromClause.containsClassAlias(FromClause.java:247)
  | 	at org.hibernate.hql.ast.tree.FromClause.isFromElementAlias(FromClause.java:135)
  | 	at org.hibernate.hql.ast.HqlSqlWalker.isNonQualifiedPropertyRef(HqlSqlWalker.java:467)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.addrExpr(HqlSqlBaseWalker.java:4382)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1212)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.functionCall(HqlSqlBaseWalker.java:2299)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:1963)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1825)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1394)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:553)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
  | 	at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
  | 

This query started failing with NPE:


  | select _this.name, _this.language.name,
  | cast (_this.dateOrder as integer)
  | from Country _this
  | left outer join _this.language
  | 

When I took out the cast, it worked, but that's not what I need.


  | select _this.name, _this.language.name,
  | _this.dateOrder
  | from Country _this
  | left outer join _this.language
  | 

But if I gave the joined association an alias, it worked again:


  | select _this.name, l.name,
  | cast (_this.dateOrder as integer)
  | from Country _this
  | left outer join _this.language l
  | 

It should be reproducible on your in-house test cases:


  | select _this.name, _this.mate.name,
  | cast(_this.weight as integer)
  | from cat _this
  | left outer join _this.mate
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053863#4053863

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053863



More information about the jboss-user mailing list