Login  Register

Re: [OFBiz] Dev - relation type one/many in entitymodel.xml

Posted by David E. Jones on Sep 07, 2005; 6:24am
URL: http://ofbiz.116.s1.nabble.com/OFBiz-Dev-relation-type-one-many-in-entitymodel-xml-tp165979p165980.html


This has been discussed a few times. Actually the Entity Engine does  
figure out what it should be and uses the relationship type as a  
sanity check and it is done on purpose that way. If your type is  
wrong for the key-maps, it will give you a warning. It is also needed  
for the special case of the one-nofk situation, but that came along  
later and wasn't the original reason. I just read over the section  
about that in the Entity Engine guide and it doesn't state this  
explicitly, but it is implied as it does state the requirements for  
the different options.

-David


On Sep 6, 2005, at 11:24 AM, Adam Heath wrote:

> So, I was thinking over the weekend; why do we have to specify the  
> type of a
> relation on an entity definition?  Shouldn't it be able to be  
> inferred by the
> set of fields you are linking to?
>
> If the set of fields on the target entity is not it's primary key  
> set, then
> it's a many relation; otherwise, it's just a one relation.
>
> If my thinking is correct, then we could remove the need of the  
> type attribute
> alltogether.
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/dev
>

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev