I am in the process of Hibernate Migration from version 2.1.6 to 3.0.5. While starting the Application Server I face some problems:
Error Trace is as follows:
Code:
21:45:27,798 INFO [SessionFactoryImpl] Checking 15 named queries
21:45:27,848 ERROR [SessionFactoryImpl] Error in named query: ABCReportDAOHibImpl.findReportColMetadataByReportGuid
org.hibernate.QueryException: could not resolve property: REPORT_GUID of: com.abc.persistence.ABCReportColMetadataDBVO [
FROM com.abc.persistence.ABCReportColMetadataDBVO AS reportColDefn
WHERE reportColDefn.REPORT_GUID = :reportId
]
Has this anything to do with the way the query is written in the hbm.xml file? Following is the query written in the problematic hbm.xml file.
Code:
<query name="ABCReportDAOHibImpl.findReportColMetadataByReportGuid">
<![CDATA[
FROM com.abc.persistence.ABCReportColMetadataDBVO AS reportColDefn
WHERE reportColDefn.REPORT_GUID = :reportId
]]>
</query>
Based on following (written in the Hibernate 3 Migration Guide) I changed the query parser to the old 2.1 query parser(org.hibernate.hql.classic.ClassicQueryTranslatorFactory). Then also it produces the same result.
Quote:
Hibernate3 comes with a brand-new, ANTLR-based HQL/SQL query translator. However, the Hibernate 2.1 query parser is still available. The query parser may be selected by setting the Hibernate property hibernate.query.factory_class. The possible values are org.hibernate.hql.ast.ASTQueryTranslatorFactory, for the new query parser, and org.hibernate.hql.classic.ClassicQueryTranslatorFactory, for the old parser. We are working hard to make the new query parser support all queries allowed by Hibernate 2.1. However, we expect that many existing applications will need to use the Hibernate 2.1 parser during the migration phase.