1
是否有任何其他方式爲Roo提供元數據?除了從命令行?定義春天roo的元數據的方法
這不會更有意義嗎?這將是整個應用程序的核心元數據定義,開發人員只會在開發過程中對其進行修改。
<entity name="CustomerAccount" local-service="true" remote-service="false">
<!-- PK fields -->
<column name="customerAccountId" type="long" primary="true" id-type="class" id-param="com.liferay.counter.service.persistence.IDGenerator" />
<!-- Audit fields -->
<column name="companyId" type="long" />
<column name="userId" type="long" />
<column name="userName" type="String" />
<column name="createDate" type="Date" />
<column name="modifiedDate" type="Date" />
<column name="emailAddress" type="String" />
<!-- Other fields -->
<column name="balance" type="Integer" />
<!-- One 2 Many -->
<column name="customerOrders" type="Collection"
entity="Order"
mapping-key="customerAccountId"
/>
<!-- Order -->
<order by="asc">
<order-column name="emailAddress" />
</order>
<!-- Finder methods -->
<finder name="U_EA" return-type="CustomerAccount">
<finder-column name="userId" />
<finder-column name="emailAddress" />
</finder>
</entity>
<entity name="TranslatorAccount" local-service="true" remote-service="false">
<!-- PK fields -->
<column name="translatorAccountId" type="long" primary="true" />
<!-- Audit fields -->
<column name="companyId" type="long" />
<column name="userId" type="long" />
<column name="userName" type="String" />
<column name="createDate" type="Date" />
<column name="modifiedDate" type="Date" />
<column name="emailAddress" type="String" />
<!-- Other fields -->
<column name="reputation" type="Integer" />
<!-- Many 2 Many -->
<!--
<column name="translatorOrders" type="Collection"
entity="Order"
mapping-table="TranslatorAccount_Order"
/>
-->
<!-- One 2 Many -->
<column name="bids" type="Collection"
entity="Bid"
mapping-key="translatorAccountId"
/>
<!-- Order -->
<order by="asc">
<order-column name="emailAddress" />
</order>
<!-- Finder methods -->
<finder name="U_EA" return-type="TranslatorAccount">
<finder-column name="userId" />
<finder-column name="emailAddress" />
</finder>
</entity>
<entity name="Order" uuid="true" local-service="true" remote-service="true">
<!-- PK fields -->
<column name="orderId" type="long" primary="true" />
<!-- FK fields -->
<column name="customerAccountId" type="long"/>
<!-- One 2 Many -->
<column name="bids" type="Collection"
entity="Bid"
mapping-key="orderId"
/>
<!-- Audit fields -->
<column name="companyId" type="long" />
<column name="userId" type="long" />
<column name="createDate" type="Date" />
<column name="modifiedDate" type="Date" />
<!-- Group instance -->
<column name="groupId" type="long" />
<!-- Other fields -->
<column name="languageFrom" type="String" />
<column name="languageTo" type="String" />
<column name="description" type="String" />
<column name="specialization" type="String" />
<column name="significanceLevel" type="Integer" />
<column name="comment" type="String" />
<column name="fileEntryIds" type="String" />
<column name="deadLine" type="Date" />
<!-- Bid related -->
<column name="currentPrice" type="Integer" />
<column name="maxValue" type="Integer" />
<column name="minValue" type="Integer" />
<column name="bidsCount" type="Integer" />
<order by="asc">
<order-column name="createDate" />
</order>
<!-- Finder methods -->
<finder name="languageFrom" return-type="Collection">
<finder-column name="languageFrom" />
</finder>
<finder name="languageTo" return-type="Collection">
<finder-column name="languageTo" />
</finder>
<finder name="U_LFT" return-type="Collection">
<finder-column name="languageFrom" />
<finder-column name="languageTo" />
</finder>
<finder name="significanceLevel" return-type="Collection">
<finder-column name="significanceLevel" />
</finder>
<finder name="createDate" return-type="Collection" >
<finder-column name="createDate" />
</finder>
<finder name="orderIdOlderThanNow" return-type="Collection" >
<finder-column name="createDate" comparator=">"/>
</finder>
<!-- References -->
<reference package-path="com.liferay.portlet.asset" entity="AssetEntry" />
<reference package-path="com.liferay.portlet.asset" entity="AssetTag" />
<reference package-path="com.liferay.portlet.ratings" entity="RatingsStats" />
<reference package-path="com.liferay.portlet.social" entity="SocialActivity" />
<reference package-path="com.liferay.portlet.social" entity="SocialEquityLog" />
</entity>
<entity name="Bid" local-service="true" remote-service="true">
<!-- PK fields -->
<column name="bidId" type="long" primary="true" />
<column name="orderId" type="long" />
<column name="translatorAccountId" type="long" />
<!-- Audit fields -->
<column name="userId" type="long" />
<column name="createDate" type="String" />
<!-- Other fields -->
<column name="bidValue" type="Integer" />
<column name="nth" type="Integer" />
<column name="resultPrice" type="Integer" />
<!-- Order -->
<order by="asc">
<order-column name="createDate" />
</order>
<finder name="orderId" return-type="Collection">
<finder-column name="orderId" />
</finder>
</entity>
<entity name="OrderState" local-service="true" >
<!-- PK fields -->
<column name="orderId" type="long" primary="true" />
<column name="orderState" type="Integer" />
<column name="stateCycle" type="Integer" />
</entity>
<entity name="Utils" local-service="false" remote-service="true"/>
是的,每個殼都應該有。但是,使用實體定義(就像其他一些源代碼生成器一樣),我可以改變實體並運行源代碼生成器來反映這些變化。我可以通過腳本中的一系列命令來做到這一點嗎?是否有刪除所有內容的命令並運行修改後的腳本? – lisak 2011-03-25 15:10:45
我的意思是這是我不喜歡roo。這個花哨的外殼。 Xml元數據定義是更加有效和自然的方式...至少你可以看到整個領域模型,你可以考慮下一步該做什麼。 – lisak 2011-03-25 16:56:39