gpt4 book ai didi

java - Spring roo 的元数据定义方法

转载 作者:行者123 更新时间:2023-11-30 05:05:05 24 4
gpt4 key购买 nike

还有其他方式向 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"/>

最佳答案

您是否考虑过脚本命令,它接受简单的文本文件输入。

关于java - Spring roo 的元数据定义方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5370873/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com