Thank you for your cool reply. Best Regards Tanakorn Numrubporn
Mridul Pathak-2 wrote: > > No foreign key indices are maintained for the one-nofk relationship, that > is > the reason why no foreign key constraints apply to a one-nofk > relationship. > This may be the reason that you are not able to locate this relation is > the > constraint part. You can find this relationship in the Webtools > application > in context of the entity you are looking for. In case of one-nofk > relationship constraints do not apply but you can fetch the related data > on > the basis of this relationship. This is the reason of keeping this > relationship, you can have access to related data but you need not to > worry > about any constraints while performing CRUD operations. > > On Wed, Jun 25, 2008 at 6:59 PM, him_aeng <[EMAIL PROTECTED]> wrote: > >> >> Sorry for asking another question. When I see to the "Real Database" that >> OFBiz just constructed and look in to the constraint part of >> "PaymentBudgetAllocation" I can't see any thing that point to the >> "one-nofk" >> thing. It show only which is "one" thing in database. Is that mean, It >> doesn't matter that you specify relation-type = one-nofk or not? The real >> entity in RDBMS remain the same (don't have relation at all). >> >> So, I just feel strange that what the purpose of "one-nofk" >> relation-type? >> >> Thank and Regards >> Tanakorn Numrubporn >> >> >> Rishi Solanki wrote: >> > >> > The relation-type = nofk is used when we need a relation but don't want >> to >> > apply foreign key constraints on it. >> > This relation comes in existance only when we need to use the attribute >> of >> > a >> > entity into another entity. And we needed >> > that when we delete/expire a record from entity say >> > "PaymentBudgetAllocation" then their is no need to delete the record >> > from "BudgetItem". In such case we specify relation-type = nofk. >> > >> > Thanks and Regards >> > [Rishi Solnaki] >> > >> > >> > >> > On Tue, Jun 24, 2008 at 5:41 PM, him_aeng <[EMAIL PROTECTED]> wrote: >> > >> >> >> >> I see you intent to make two of compound key (budgetId and >> >> budgetItemSeqId) >> >> of PaymentBudgetAllocation entity have relation-type = nofk that not >> >> similar >> >> to "The Data Model Resource Book Vol.1" in Figure 8.10. I think you >> have >> >> to >> >> has a good reason for implementation >> >> >> >> /applications/accounting/entitydef/entitymodel.xml >> >> >> >> <entity entity-name="PaymentBudgetAllocation" >> >> package-name="org.ofbiz.accounting.payment" >> >> title="Payment Budget Allocation Entity"> >> >> <field name="budgetId" type="id-ne"></field> >> >> <field name="budgetItemSeqId" type="id-ne"></field> >> >> <field name="paymentId" type="id-ne"></field> >> >> <field name="amount" type="currency-amount"></field> >> >> <prim-key field="budgetId"/> >> >> <prim-key field="budgetItemSeqId"/> >> >> <prim-key field="paymentId"/> >> >> <relation type="one" fk-name="PAYMENT_BA_BDGT" >> >> rel-entity-name="Budget"> >> >> <key-map field-name="budgetId"/> >> >> </relation> >> >> - <relation type="one-nofk" rel-entity-name="BudgetItem"> >> >> + <relation type="one" fk-name="PAYMENT_BUDGIT" >> >> rel-entity-name="BudgetItem"> >> >> <key-map field-name="budgetId"/> >> >> <key-map field-name="budgetItemSeqId"/> >> >> </relation> >> >> <relation type="one" fk-name="PAYMENT_BA_PMT" >> >> rel-entity-name="Payment"> >> >> <key-map field-name="paymentId"/> >> >> </relation> >> >> </entity> >> >> >> >> and another question in the same figure in the book (Figure 8.10). In >> >> order_item entity has two attribute that is budgetId and >> budgetItemSeqId >> >> but >> >> you don't use it to link to budget_item entity, and I don't know why? >> >> >> >> /applications/order/entitydef/entitymodel.xml >> >> >> >> <entity entity-name="OrderItem" >> >> package-name="org.ofbiz.order.order" >> >> never-cache="true" >> >> title="Order Item Entity"> >> >> <field name="orderId" type="id-ne"></field> >> >> <field name="orderItemSeqId" type="id-ne"></field> >> >> <field name="externalId" type="id"></field> >> >> <field name="orderItemTypeId" type="id-ne"></field> >> >> <field name="orderItemGroupSeqId" type="id-ne"></field> >> >> <field name="isItemGroupPrimary" type="indicator"></field> >> >> <field name="fromInventoryItemId" type="id"></field> >> >> <field name="budgetId" type="id"></field> >> >> <field name="budgetItemSeqId" type="id"></field> >> >> ... >> >> + <relation type="one" fk-name="ORDER_ITEM_BUDGET_ITEM" >> >> rel-entity-name="BudgetItem"> >> >> + <key-map field-name="budgetId"/> >> >> + <key-map field-name="budgetItemSeqId"/> >> >> + </relation> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/Many-entities-that-should-has-foreign-key-but-it-not%2C-why--tp18089666p18089666.html >> >> Sent from the OFBiz - User mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Many-entities-that-should-has-foreign-key-but-it-not%2C-why--tp18089666p18112499.html >> Sent from the OFBiz - User mailing list archive at Nabble.com. >> >> > > > -- > Thanks & Regards > Mridul Pathak > Hotwax Media > http://www.hotwaxmedia.com > [EMAIL PROTECTED] > > -- View this message in context: http://www.nabble.com/Many-entities-that-should-has-foreign-key-but-it-not%2C-why--tp18089666p18127155.html Sent from the OFBiz - User mailing list archive at Nabble.com.
