ColdFusioning.com
My personal blog about ColdFusion, code, Google, & computers...
ColdFusioning: Pronunciation \kold-fy�-zhn-ing\ Noun: The action of one that writes ColdFusion.
ColdFusion ORM: Error while executing the Hibernate query - table is not mapped exception
I'm starting to learn ORM and figured I'd post some simple but confusing problems I've run into. The first is I kept getting the error:
Error while executing the Hibernate query.
org.hibernate.hql.ast.QuerySyntaxException: tablename is not mapped
This was my ORM code:
<cfset request.id = 0 />
<cfscript>
categories = ormExecuteQuery("from categories where ParentID = ?", [request.ID]);
</cfscript>
Apparently, because my cfc is named Categories.cfc and I didn't capitalize "categories" inside of the ormExecuteQuery, it was throwing the error. If I cahnge it to:
<cfset request.id = 0 />
<cfscript>
categories = ormExecuteQuery("from Categories where ParentID = ?", [request.ID]);
</cfscript>
The code works. A simple capitalization error that doesn't seem obvious because ColdFusion is largely not case sensitive.
Comments
[Add Comment]
[Subscribe to Comments]
# Posted By Brad Wood
| 10/24/09 2:41 PM
# Posted By Rupesh Kumar
| 10/26/09 2:36 AM
# Posted By James Brown
| 10/26/09 2:38 AM
[Add Comment]
