Is it possible to re-use ColdFusion ORM objects across applications?
For example, I set up an ORM-enabled application named app1 in a folder named app1. I created a department.cfc that corresponds to a department database table:
<cfcomponent>
<cfset this.name = "app1">
<cfset this.ormenabled = "true">
<cfset this.ormSettings = {
datasource = "myDS",
schema = "mySchema",
dialect = "Oracle10g",
logSQL = "false"
}>
I can load and dump the contents from a CFM file:
<cfset item = EntityLoad("department")>
<cfdump var="#item#">
Then I set up an identical ORM-enabled application named app2 in a folder named app2. I created a department.cfc there that extends the department.cfc in app1:
<cfcomponent persistent="true" extends="my.path.app1.department">
</cfcomponent>
When I try to load and dump the contents, I get an error:
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code. Null Pointers are another name for undefined values.
I have verified that the path is correct. E.g. I was able to instantiate the object using CreateObject:
<cfset item = CreateObject("component","my.path.app1.department")>
<cfdump var = "#item#">
I am hoping that I can refer to a single CFC and re-use the object, but unless I'm missing something it looks like it may be necessary to recreate the object in app2.