Can CF9 ORM use non-root package/directory structures?
Hi all,
I can't seem to make any persistent entity CFCs recognize others in different directories or pacakge structures. Even virtual mappings don't seem to do the trick. I posted part of this question yesterday (thread 2719488), althought the central focus there was was on parameter passing problems (which I'm hoping are independent!).
Looking through all the official documentation along with various online blog examples, I couldn't find a single one where non-root directory structures were used. This sounds like a crazy question, but do CF9 ORM objects support directories?!
Here's the short version of my setup and the various things I've tried to resolve it:
- PersonDAO.cfc -
<cffunction name="getAll" access="remote" returnType="PersonVO[]">
<cfscript>
return entityLoad("PersonVO");
</cfscript>
</cffunction>
-PersonVO.cfc-
<cfcomponent alias="com.foo.PersonVO" persistent="true" table="PERSON">
<cfproperty name="pk" fieldtype="id" ormtype="long" column="PERSON_PK">
<cfproperty name="employeeId" column="EMP_ID">
<cfproperty name="userLoginId" column="USR_LOGIN_ID">
</cfcomponent>
I can only get EntityLoad to work when the DAO and VOs are in the same directory, and they're referenced by their class name alone (not package name or alias name).
- My entity is located at C:/ColdFusion9/wwwroot/MyApp/com/foo/PersonVO.cfc
- In my DAO, returnType="PersonVO" or "PersonVO[]" works just fine so long as the DAO is in the same directory as the VO
- When having them in the same directory, it can be any directory (not just root).
- The DAO cannot find the object type when it is in another directory
- When having them in the same directory, it can be any directory (not just root).
- The following return types on the DAO cffunction above don't recognize the object
- com.foo.PersonVO
- MyApp.com.foo.PersonVO
- Even if I created a mapping with a virtualName of "cfcs" and point it at "C:/ColdFusion9/wwwroot/MyApp/com/foo", the following won't work
- cfcs.PersonVO
- MyApp.cfcs.PersonVO
- Every combination of the above, where PersonVO.cfc is in placed in wwwroot, then when PersonVO.cfc is placed in wwwroot/MyApp won't work.
Non-ORM objects have been working just fine, so I don't think it's confuguration. I tried altering every possible cfcomponent and Application.cfc property that makes sense, but could not find a way to reference VOs in another directory. Any help? I've tried this on a local CF server and on a QA server that's being well-used and has no known configuration issues.
