Copy link to clipboard
Windows 2012, CF11, IIS
First, I have the following in my application.cfc:
this.ormsettings.dbcreate = "update";
this.ormsettings.flushAtRequestEnd = false;
this.ormsettings.cfclocation=expandpath('/model'); // I've also tried "C:\full\path\model"
My models are in my /model folder.
Error while executing the Hibernate query.org.hibernate.hql.internal.ast.QuerySyntaxException:
List is not mapped [ from List where listtypeid = 2 and user.userid = ? ] The specific sequence of files included or processed is:
C:\inetpub\vhosts\xxxx\xxxx\sms\index.cfm, line: 7 "
<Cfquery name="lists" dbtype="hql">
where listtypeid = 2
and user.userid = <cfqueryparam cfsqltype="cf_sql_integer" value="#session.userid#">
I have a few calls prior to the cfquery dbtype=hql using entityloadbypk() such as
that work fine.
The wierd thing is to fix it... if I go to my models/List.cfc file... add a blank anywhere in the file and save it, and then do an ORMReload(), it comes up with no problem.
It only happens after the CF service gets restarted.
ifSteve - I've had the same problem recently and can concurr that the entityload etc works fine unless you do a HQL then it breaks.
I wrote this function which I call as part of my applications setup which basically tests a very basic HQL and if it fails it restarts the Application.
<cffunction name="testConnection" hint="I make sure ORM has been correctly initiated">
<cfquery name="local.prospects" dbtype="hql">
where 0 = 1
<cflocation url="#cgi.script_name#?#cgi.query_string#" addtoken="no" statuscode="302">
Hope it helps!