So currently we have an infrastructure that resembles multiple "apps". Each app has it's own ORM models/components folders, however there are some cases where the ORM components need to reference information across apps. There is one application.cfc that is at the root of all apps.
I have a setup that looks similiar to the following directory structure:
/Application.cfc
/app1/cfcs/models/
/app2/cfcs/models/
In application.cfc, the following is defined:
this.mappings = {
...
"/app1Models" = "/full/path/to/app1/cfcs/models",
"/app2Models" = "/full/path/to/app2/cfcs/models",
...
}
And then the ORM config has:
this.ormSettings = {
...
cflocation = ["/app1Models", "/app2Models"],
...
}
So this works just fine as long as any of the property CFC attributes reference a component within the same folder, but if I try something where an app1 component relates to a app2 component via a cfproperty tag, it cannot find the component.
IE within app1/Model.cfc,
...cfproperty name="app2Relationsip" cfc="/app2Models/Model2"...
I tried using:
/app2Models/app2Model1
app2Models/app2Model1
/app2Models.app2Model
app2Models.app2Model
All of which yielded one form or another of CF's inability to locate the app2 model.
Thoughts? Is this just a nono with the ORM?
--
You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cf-orm-dev+...@googlegroups.com.
To post to this group, send email to cf-or...@googlegroups.com.
Visit this group at http://groups.google.com/group/cf-orm-dev.
For more options, visit https://groups.google.com/d/optout.
From the looks of it, I gave a slightly inaccurate example of how my setup is. Right now, it looks like this (with the mapping and orm cfclocation as outlined in the first post).
this.mappings = {
...
"/baseModels" = "/full/path/to/cfcs/baseModels",
"/app1Models" = "/full/path/to/app1/cfcs/models",
"/app2Models" = "/full/path/to/app2/cfcs/models",
...
}
/cfcs/baseModels/
/app1/cfcs/models/
/app2/cfcs/models/
/application.cfc
Now, as long as I don't reference components in different folders, everything works fine.
I can also create a reference from one of the app model folders to /cfcs/basemodels.
As an example, within /app1/cfcs/models/ I can set:
property name="foo" fieldtype="one-to-many" cfc="baseModels.bar";
However, I can't do it the other way around. Within /cfcs/baseModels, I can't do
property name="foo" fieldtype="many-to-one" cfc="app1Models.bar";
This ends up throwing a "cannot initialize component for relationship "foo". Can't find component".