-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: -> DOT node with no left-hand-side! <- after 3.1.3 to
PostPosted: Wed Oct 18, 2006 2:30 pm 
Newbie

Joined: Tue Oct 03, 2006 3:35 pm
Posts: 9
Location: São Paulo
Hi all.

This method used to work perfectly before the migration....

---
public Integer getNbrOfNonAutomaticActivities(Long flowId) throws DAOException {

Integer listing = null;
Iterator it = null;
try{
String hql = new StringBuffer("select size(a) from Flow f join f.activities a where ")
.append(" a.class != myPkg.AutomaticActivity and f.id = :id ").toString();

it = getSession().createQuery(hql).setParameter("id", flowId) .iterate();
listing = (Integer)it.next();
}catch(Exception e){
throw new DAOException(e);
}finally{
Hibernate.close(it);
}
return listagem;
}

PS: architectured with an open-session-in-view-with-detached-objects

---
Any help?

Cheers,

:Lui.


Top
 Profile  
 
 Post subject: Query parser.
PostPosted: Wed Oct 18, 2006 5:15 pm 
Newbie

Joined: Tue Oct 03, 2006 3:35 pm
Posts: 9
Location: São Paulo
I realized that there is a problem for parsing this query:

select size(a) from Flow f join f.activities a where a.class != myPkg.AutomaticActivity and f.id = :id


Specifically, when parsing a.class != myPkg.AutomaticActivity


What's the problem with this in this version?


Tnx,


:Lui.


Top
 Profile  
 
 Post subject: the stackTrace.
PostPosted: Wed Oct 18, 2006 5:40 pm 
Newbie

Joined: Tue Oct 03, 2006 3:35 pm
Posts: 9
Location: São Paulo
19:25:58,415 INFO [STDOUT] java.lang.IllegalStateException: DOT node with no left-hand-side!
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.ast.tree.DotNode.getLhs(DotNode.java:559)
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:534)
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.ast.tree.BinaryLogicOperatorNode.extractDataType(BinaryLogicOperatorNode.java:168)
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.ast.tree.BinaryLogicOperatorNode.initialize(BinaryLogicOperatorNode.java:35)
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.ast.HqlSqlWalker.prepareLogicOperator(HqlSqlWalker.java:1014)
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3992)
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1762)
19:25:58,431 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1687)
19:25:58,446 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
19:25:58,446 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
19:25:58,446 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
19:25:58,446 INFO [STDOUT] at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
19:25:58,446 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
19:25:58,446 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
19:25:58,446 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
19:25:58,446 INFO [STDOUT] at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
19:25:58,446 INFO [STDOUT] at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
19:25:58,462 INFO [STDOUT] at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
19:25:58,462 INFO [STDOUT] at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
19:25:58,462 INFO [STDOUT] at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
19:25:58,462 INFO [STDOUT] at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)


Top
 Profile  
 
 Post subject: FOUND IT!
PostPosted: Wed Oct 18, 2006 6:19 pm 
Newbie

Joined: Tue Oct 03, 2006 3:35 pm
Posts: 9
Location: São Paulo
Can't I use the FQCN when designing polymorphic queries anymore???

The result was:

select size(a) from Flow f join f.activities a where a.class != AutomaticActivity and f.id = :id

INSTEAD OF:

select size(a) from Flow f join f.activities a where a.class != myPkg.AutomaticActivity and f.id = :id


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.