-->
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: Invalid path problems
PostPosted: Fri Jul 01, 2005 11:30 pm 
Newbie

Joined: Thu Mar 31, 2005 11:59 pm
Posts: 10
I get an the error:*** ERROR: Invalid path: 'sf.personID'
ERROR PARSER: *** ERROR: <AST>:0:0: unexpected end of subtree
Exception in thread "AWT-EventQueue-0" org.hibernate.hql.ast.QuerySyntaxError: Invalid path: 'sf.personID' [from com.schwarcz.tools.cobbler.SourceFile where sf.personID <> 1 and project = :project]

The original query is:
from SourceFile where sf.personID <> 1 and project = :project

All the other queries that I have with the where clause uses sf.personID work fine. For example, this works fine:

select sum(sf.size) from SourceFile sf where (sf.personID != 1 and not sf.personID is null) and sf.project = :project"

I assume that this is my bug, but can anybody explain what is going on here. I've been staring at variants of this for hours!

Hibernate version: 3.0.2

Mapping documents:
<class name="com.schwarcz.tools.cobbler.SourceFile" table="sourcefile" lazy="false">
<id name="id" column="source_id">
<generator class="native"/>
</id>

<property name="name" column="name"/>

<many-to-one name="project" class="com.schwarcz.tools.cobbler.Project"
column="project"
cascade="all"
not-null="true"/>

<property name="extension" length="25"/>

<property name="type" />
<property name="javaPackage" />
<property name="completePath" not-null="true" />
<property name="size" />
<property name="directory" not-null="true"/>
<property name="audited" />
<property name="outOfScope" />
<property name="team" />
<property name="note" />
<property name="changeDate" not-null="false" />
<property name="modificationDate" not-null="false" />
<property name="personID" not-null="false" />

</class>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:196)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:422)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:822)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:782)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)

Name and version of the database you are using: MySQL 4.1.12-nt-max

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 01, 2005 11:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
wow!

so what exactly is the 'sf' in 'sf.personID'?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 02, 2005 12:00 am 
Newbie

Joined: Thu Mar 31, 2005 11:59 pm
Posts: 10
Thanks! Sorry for going code blind!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 02, 2005 12:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
hehe


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.