首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Transfer-ORM:在对象'siteID‘中找不到属性'siteUsers.siteUsers’

Transfer-ORM:在对象'siteID‘中找不到属性'siteUsers.siteUsers’
EN

Stack Overflow用户
提问于 2010-01-21 21:48:39
回答 2查看 220关注 0票数 0

当使用Transfer映射到我的Microsoft数据库时,我将得到以下Cold聚变错误。我认为这是由一个配置错误的transfer.xml文件造成的,该文件映射了我的链接表。我不确定我完全理解合成id的细微差别。你看到错误了吗?

错误:

找不到搜索的属性,在对象'siteID‘中找不到属性'siteUsers.siteUsers’

index.cfm:

代码语言:javascript
复制
<cfset transfer = application.transferFactory.getTransfer()>
<cfset obj = transfer.new("users.users")>
<cfdump var="#obj#">

transfer.xml:(相关部分-我认为siteUsers包中存在问题)

代码语言:javascript
复制
<package name="users">

  <object name="users" table="users" >
    <id name="userID" type="string" generate="true"/>
    <property name="username" type="string" column="username" nullable="false"/>
    <property name="friendlyName" type="string" column="friendlyName" nullable="true"/>
    <property name="email" type="string" column="email" nullable="true"/>
    <property name="isEnabled" type="boolean" column="isEnabled" nullable="false"/>

    <onetomany name="pages" lazy="true">
      <link to="pages.pages" column="lastModUserID"/>
        <collection type="array">
          <order property="pageID" order="asc"/>
        </collection>
    </onetomany>

    <onetomany name="siteUsers" lazy="true">
      <link to="siteUsers.siteUsers" column="userID"/>
      <collection type="array">
        <order property="siteID" order="asc"/>
      </collection>
    </onetomany>

    <onetomany name="textContent" lazy="true">
      <link to="textContent.textContent" column="authorID"/>
      <collection type="array">
        <order property="textContentID" order="asc"/>
      </collection>
    </onetomany>

    <onetomany name="textContent" lazy="true">
      <link to="textContent.textContent" column="approvalUserID"/>
      <collection type="array">
        <order property="textContentID" order="asc"/>
      </collection>
    </onetomany>
  </object>

</package>

<package name="siteUsers">

  <object name="siteUsers" table="siteUsers" >
    <compositeid>
      <manytoone name="siteID" />
      <manytoone name="userID" />
    </compositeid>
    <property name="accessLevel" type="string" column="accessLevel" nullable="false"/>

    <manytoone name="siteID">
      <link to="sites.sites" column="siteID"/>
    </manytoone>

    <manytoone name="userID">
      <link to="users.users" column="userID"/>
    </manytoone>
  </object>

</package>

<package name="sites">
  <object name="sites" table="sites" >
    <id name="siteID" type="string" generate="true"/>
    <property name="themeID" type="string" column="themeID" nullable="true"/>
    <property name="sitename" type="string" column="sitename" nullable="false"/>
    <property name="menuName" type="string" column="menuName" nullable="true"/>
    <property name="menuID" type="string" column="menuID" nullable="true"/>
    <property name="description" type="string" column="description" nullable="true"/>
    <property name="basepath" type="string" column="basepath" nullable="true"/>
    <property name="reqApproval" type="boolean" column="reqApproval" nullable="false"/>
    <property name="enabled" type="boolean" column="enabled" nullable="false"/>
    <property name="redirectPath" type="string" column="redirectPath" nullable="true"/>

    <onetomany name="fileFolders" lazy="true">
      <link to="fileFolders.fileFolders" column="siteID"/>
      <collection type="array">
        <order property="fileFolderID" order="asc"/>
      </collection>
    </onetomany>

    <onetomany name="pages" lazy="true">
      <link to="pages.pages" column="siteID"/>
      <collection type="array">
        <order property="pageID" order="asc"/>
      </collection>
    </onetomany>

    <onetomany name="siteHandlers" lazy="true">
      <link to="siteHandlers.siteHandlers" column="siteID"/>
      <collection type="array">
        <order property="siteID" order="asc"/>
      </collection>
    </onetomany>

    <onetomany name="siteOptions" lazy="true">
      <link to="siteOptions.siteOptions" column="siteID"/>
      <collection type="array">
        <order property="siteOptionID" order="asc"/>
      </collection>
    </onetomany>

    <onetomany name="siteUsers" lazy="true">
      <link to="siteUsers.siteUsers" column="siteID"/>
      <collection type="array">
        <order property="siteID" order="asc"/>
      </collection>
    </onetomany>
  </object>

</package>
EN

回答 2

Stack Overflow用户

发布于 2010-01-21 23:07:57

可能的原因是您为相同的关系同时定义了o2m和m2o。我记得,这是不允许的。

票数 0
EN

Stack Overflow用户

发布于 2010-01-22 16:18:51

要正确配置Transfer-ORM,需要对配置文件进行三项验证:

  1. 它是否有正确的XML格式?
  2. 它是否符合transfer.xsd模式文件?
  3. transfer.xml中的关系与数据库中的关系匹配吗?

我通过了对#1和#2的验证,但是在#3中使用了错误的关系标记。

更多信息:

  • 使用组合键
  • 管理关系和组成
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2113195

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档