Since I have a few complicated queries, I thought it would be better to use named query method and definite them outside of Java DAO class. Followed the sample application from the "Professional J2EE with Spring framework", I have those queries definited in the queries.hbm.xml file. For example, I have the following definition:
<query name="getByTopic">
<![CDATA[
from Article ae left join Topic t
where ae.id = t.entry
and ae.status = 1
and t.keynote = :topic
order by ae.publishedDate desc
]]>
</query>
During the configuration, I get an error as:
org.hibernate.hql.ast.QuerySyntaxError: Path expected for join! [
from com.xxx.domain.Article ae left join Topic t
where ae.id = t.entry
and ae.status = 1
and t.keynote = :topic
order by ae.publishedDate desc
]
Since I saw the full path is added into the Article class, I add the path to the Topic class. This time, the sessionFactory, which is configured with the hbm.xml file, can't initiated without much usefull information.
What I am missing here?
Thanks for your inputs in advance.
v.


Reply With Quote