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:
|