开发者

unmapped class error with coldfusion 9.0.1 orm

开发者 https://www.devze.com 2023-02-04 15:23 出处:网络
i have to model classes User and Order. what i want is to have a relationship be开发者_C百科tween them, so that a user has many orders, which in this case would be a one-to-many rel. which i defined i

i have to model classes User and Order. what i want is to have a relationship be开发者_C百科tween them, so that a user has many orders, which in this case would be a one-to-many rel. which i defined in the User.cfc as follows:

property name="orders"
         fieldtype="one-to-many"
         cfc="Order"
         fkcolumn="userID"
         type="array";

each of this cfcs can be loaded through EntityLoad( Entity Name ) without any problems; i see all the data in the dump output.

however, as soon as i put the orders relationship in the User.cfc, it all breaks apart and i get an error message:

Association references unmapped class: Order

here's the code for the cfcs

User.cfc

component persistent="true" datasource="otherDatasource"
{
    property    name="id" fieldtype="id";
    property    name="userName";
    property    name="password";
    property    name="firstName";
    property    name="lastName";
    property    name="title";
    property    name="orders"
                fieldtype="one-to-many"
                cfc="Order"
                fkcolumn="userID"
                type="array";

    function init()
    {
        return this;
    }
}

Order.cfc

component persistent="true"
{
    property name="id" fieldtype="id" generator="guid";
    property name="quantity";
    property name="period";
    property name="region";
    property name="createdAt" ormtype="date";

    function init()
    {
        return this;
    }
}

Any ideas what i'm doing wrong here?


it seems as i have my answer. coldfusion 9.0.1 orm isn't capable of building a relationship between tables in different databases.

0

精彩评论

暂无评论...
验证码 换一张
取 消