我的工作在CFML(Railo)父/子應用程序的結構,我有我的延長持續(ORM)氟氯化碳掙扎。擴展ORM持久的氟氯化碳父/子應用
我想要的是我的持久性CFCs住在父應用程序中。它們將包含各種屬性以及一些處理核心功能的函數。
在我的子應用程序中,我想擴展ORM CFC,聲明任何子應用程序特定的屬性,我希望能夠添加特定於子應用程序需求的新功能,以及覆蓋任何核心功能(如果需要的話),而不觸及父應用程序的CFC中的代碼。
子應用程序使用它自己的數據源,所以我希望看到在子的在應用程序啓動數據庫中生成的ORM表。如果我啓動父應用程序(它運行獨立並有自己的數據源),我可以看到在那裏生成的表沒有問題。但是,如果我啓動子應用程序,則不會生成這些表(在任一數據庫中)。
我嘗試添加mappedSuperclass='true'
父CFC和在兒童的應用程序,擴展父氯氟烴創建CFC。 我也嘗試添加父應用程序的ORM文件夾到ORM設置中的CFCLocation文件夾數組。
我能爲表明了ORM正在使用的唯一的事情,就是看錶是否在數據庫中生成。如果還有其他方法,我可以看到ORM CFC是否正在運行,我很想聽聽它!
下面是一些代碼來看看:
家長image.cfc
<cfcomponent persistent="true" entityname="Image" table="tblImages_Base" extends="com.orm.SimpleBasePersistentObject" mappedSuperClass="true">
<!--- Identifier --->
<cfproperty name="sImageUUID" fieldtype="id" generator="assigned" setter="false" />
<!--- Properties --->
<cfproperty name="dtDateCreated" ormtype="timestamp" setter="false" />
<cfproperty name="dtLastUpdated" ormtype="timestamp" setter="false" />
<cfproperty name="sFileName" ormtype="string" />
<cfproperty name="iFileSize" ormtype="int" default="0" dbdefault="0" />
<cfproperty name="iWidth" ormtype="int" default="0" dbdefault="0" />
<cfproperty name="iHeight" ormtype="int" default="0" dbdefault="0" />
<cfproperty name="sImageFolder" ormtype="string" dbdefault="" />
<cfproperty name="Active" ormtype="boolean" default="0" dbdefault="0" notnull="true" />
<!--- Non persistant properties --->
<cfproperty name="sImagePath" type="string" persistent="false" />
<cfproperty name="sDefaultImageLocation" persistent="false" />
<!--- Many Images can have one image type --->
<cfproperty name="ImageType"
fieldtype="many-to-one"
cfc="ImageType"
fkcolumn="fk_sImageType"
fetch="join"
/>
</cfproperty>
</cfcomponent>
子image.cfc
<cfcomponent persistent="true" entityname="Image" table="tblImages_Base" extends="core.orm.Image">
</cfcomponent>
感謝您的響應。我想我和你在一起...我會放棄並報告回來。 –