entityNew results in error
Hi! I started to learn CF9 and wanted to try the ORM features, but i am getting an error when
calling the entityNew() - methode
So i enabled ORM in my application.cfc by using the line
<cfset this.ormenabled = "true">
then i create the entity cfc in package components/orm/abteilung.cfc, which looks like this:
<cfcomponent persistent="true">
<cfproperty name="abteilung_id" fieldType="id" generator="native">
<cfproperty name="bezeichnung" ormtype="string">
<cfproperty name="abtnr" ormtype="string">
</cfcomponent>
I tried the to get the data using <cfQuery> and it works fine. But when i try to create a new entity
using (ColdfusionBuilder presents me 'abteilung' for selection when i type the command)
<cfset abt = entityNew("abteilung")>
this results in an error.
I already tried to create the entity after setting the path to the cfc folder and defining the dialect
<cfset this.ormsettings.cfclocation = "components/orm/">
<cfset this.ormsettings.dialect = "Informix">
The error appearing is:
onRequest: coldfusion.runtime.EventHandlerException: Event handler exception
and the code calling is as following:
<h1>Print Abteilungen</h1>
<cfquery name="test">
SELECT * FROM abteilung
</cfquery>
<cfdump var="#test#" >
<cfset a=entityNew("abteilung") >
<cfdump var="#a#" >
Everything works fine until i added the entityNew - call
As i found out on google entityNew does only create an instance of the passed cfc name, and doesn't use the database
or hibernate/Orm methodes... so i have no idea how to solve that.
Can anyone help? Would be much appriciated!
All the best Florian
