Re: svn commit: r833113 - in /ofbiz/trunk/applications: party/entitydef/entitymodel.xml product/entitydef/entitymodel.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r833113 - in /ofbiz/trunk/applications: party/entitydef/entitymodel.xml product/entitydef/entitymodel.xml

Scott Gray-2
Hi Jacques,

Have you tested this?  Changing the relationship from one to many  
implies that there is a contactMechId on the GeoPoint entity but that  
isn't the case right?

Also was it your intention that the relationship name now becomes  
PointGeoPoint?

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 6/11/2009, at 7:26 AM, [hidden email] wrote:

> Author: jleroux
> Date: Thu Nov  5 18:26:27 2009
> New Revision: 833113
>
> URL: http://svn.apache.org/viewvc?rev=833113&view=rev
> Log:
> Change "Geo Point" title to "Point"
> Change the type of relation for Postal Address to GeoPoint from one  
> to many. Because of the elevation field in GeoPoint. A bit scifi for  
> now, but maybe useful one day...)
> Thanks to a discussion with Erwan "Relation title not needed on  
> Facility entity" at https://issues.apache.org/jira/browse/OFBIZ-3153 
> - OFBIZ-3153
>
> Modified:
>    ofbiz/trunk/applications/party/entitydef/entitymodel.xml
>    ofbiz/trunk/applications/product/entitydef/entitymodel.xml
>
> Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=833113&r1=833112&r2=833113&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/applications/party/entitydef/entitymodel.xml  
> (original)
> +++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Thu  
> Nov  5 18:26:27 2009
> @@ -1171,7 +1171,7 @@
>       <relation type="one" fk-name="POST_ADDR_PCGEO"  
> title="PostalCode" rel-entity-name="Geo">
>         <key-map field-name="postalCodeGeoId" rel-field-name="geoId"/>
>       </relation>
> -      <relation type="one" fk-name="POST_ADDR_GEOPT" title="Geo  
> Point" rel-entity-name="GeoPoint">
> +      <relation type="many" fk-name="POST_ADDR_GEOPT" title="Point"  
> rel-entity-name="GeoPoint"> <!-- because of the elevation field in  
> GeoPoint we may face a many relationship in future -->
>         <key-map field-name="geoPointId"/>
>       </relation>
>       <index name="ADDRESS1_IDX">
>
> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=833113&r1=833112&r2=833113&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml  
> (original)
> +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Thu  
> Nov  5 18:26:27 2009
> @@ -1026,7 +1026,7 @@
>         <relation type="many" rel-entity-name="FacilityTypeAttr">
>             <key-map field-name="facilityTypeId"/>
>         </relation>
> -        <relation type="one" fk-name="FACILITY_GEOPT" title="Geo  
> Point" rel-entity-name="GeoPoint">
> +        <relation type="one" fk-name="FACILITY_GEOPT" title="Point"  
> rel-entity-name="GeoPoint">
>           <key-map field-name="geoPointId"/>
>         </relation>
>     </entity>
>
>


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r833113 - in /ofbiz/trunk/applications: party/entitydef/entitymodel.xml product/entitydef/entitymodel.xml

Jacques Le Roux
Administrator
Hi Scott,

Inline..

From: "Scott Gray" <[hidden email]>
> Hi Jacques,
>
> Have you tested this?  Changing the relationship from one to many  implies that there is a contactMechId on the GeoPoint entity
> but that  isn't the case right?

Why would we need contactMechId on GeoPoint ? The relation is established through geoPointId and that's enough. Same for Facility.

 > Also was it your intention that the relationship name now becomes
> PointGeoPoint?

Erwan did not like to call  getRelated("Geo pointGeoPoint"), and I agree it's not beautiful, even if it works (see Jira for
more...).


Jacques

> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 6/11/2009, at 7:26 AM, [hidden email] wrote:
>
>> Author: jleroux
>> Date: Thu Nov  5 18:26:27 2009
>> New Revision: 833113
>>
>> URL: http://svn.apache.org/viewvc?rev=833113&view=rev
>> Log:
>> Change "Geo Point" title to "Point"
>> Change the type of relation for Postal Address to GeoPoint from one  to many. Because of the elevation field in GeoPoint. A bit
>> scifi for  now, but maybe useful one day...)
>> Thanks to a discussion with Erwan "Relation title not needed on  Facility entity" at
>> https://issues.apache.org/jira/browse/OFBIZ-3153  - OFBIZ-3153
>>
>> Modified:
>>    ofbiz/trunk/applications/party/entitydef/entitymodel.xml
>>    ofbiz/trunk/applications/product/entitydef/entitymodel.xml
>>
>> Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=833113&r1=833112&r2=833113&view=diff
>> = = = = = = = = ======================================================================
>> --- ofbiz/trunk/applications/party/entitydef/entitymodel.xml  (original)
>> +++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Thu  Nov  5 18:26:27 2009
>> @@ -1171,7 +1171,7 @@
>>       <relation type="one" fk-name="POST_ADDR_PCGEO"  title="PostalCode" rel-entity-name="Geo">
>>         <key-map field-name="postalCodeGeoId" rel-field-name="geoId"/>
>>       </relation>
>> -      <relation type="one" fk-name="POST_ADDR_GEOPT" title="Geo  Point" rel-entity-name="GeoPoint">
>> +      <relation type="many" fk-name="POST_ADDR_GEOPT" title="Point"  rel-entity-name="GeoPoint"> <!-- because of the elevation
>> field in  GeoPoint we may face a many relationship in future -->
>>         <key-map field-name="geoPointId"/>
>>       </relation>
>>       <index name="ADDRESS1_IDX">
>>
>> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=833113&r1=833112&r2=833113&view=diff
>> = = = = = = = = ======================================================================
>> --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml  (original)
>> +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Thu  Nov  5 18:26:27 2009
>> @@ -1026,7 +1026,7 @@
>>         <relation type="many" rel-entity-name="FacilityTypeAttr">
>>             <key-map field-name="facilityTypeId"/>
>>         </relation>
>> -        <relation type="one" fk-name="FACILITY_GEOPT" title="Geo  Point" rel-entity-name="GeoPoint">
>> +        <relation type="one" fk-name="FACILITY_GEOPT" title="Point"  rel-entity-name="GeoPoint">
>>           <key-map field-name="geoPointId"/>
>>         </relation>
>>     </entity>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r833113 - in /ofbiz/trunk/applications: party/entitydef/entitymodel.xml product/entitydef/entitymodel.xml

Scott Gray-2
Please explain to me how the many relationship will be presented in  
the database.  I was not suggesting that a contactMechId should be  
present on GeoPoint, I was trying to point out that you cannot simply  
change a relationship from one to many without making field changes.

Your current relationship definition is attempting to tell the entity  
engine that PostalAddress.geoPointId points to many GeoPoints which  
obviously isn't possible since GeoPoint.geoPointId is that primary key.

I still the think relationship name is not following best practices.  
As Erwan pointed out in the jira issue, a relationship title is  
typically only used when there a multiple relationships to the same  
entity as a means to distinguish those relationships.  PointGeoPoint  
has no meaning and would be better as simply GeoPoint.

Regards
Scott

On 6/11/2009, at 11:53 AM, Jacques Le Roux wrote:

> Hi Scott,
>
> Inline..
>
> From: "Scott Gray" <[hidden email]>
>> Hi Jacques,
>>
>> Have you tested this?  Changing the relationship from one to many  
>> implies that there is a contactMechId on the GeoPoint entity but  
>> that  isn't the case right?
>
> Why would we need contactMechId on GeoPoint ? The relation is  
> established through geoPointId and that's enough. Same for Facility.
>
> > Also was it your intention that the relationship name now becomes
>> PointGeoPoint?
>
> Erwan did not like to call  getRelated("Geo pointGeoPoint"), and I  
> agree it's not beautiful, even if it works (see Jira for more...).
>
>
> Jacques
>
>> Regards
>> Scott
>>
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>> On 6/11/2009, at 7:26 AM, [hidden email] wrote:
>>
>>> Author: jleroux
>>> Date: Thu Nov  5 18:26:27 2009
>>> New Revision: 833113
>>>
>>> URL: http://svn.apache.org/viewvc?rev=833113&view=rev
>>> Log:
>>> Change "Geo Point" title to "Point"
>>> Change the type of relation for Postal Address to GeoPoint from  
>>> one  to many. Because of the elevation field in GeoPoint. A bit  
>>> scifi for  now, but maybe useful one day...)
>>> Thanks to a discussion with Erwan "Relation title not needed on  
>>> Facility entity" at https://issues.apache.org/jira/browse/ 
>>> OFBIZ-3153  - OFBIZ-3153
>>>
>>> Modified:
>>>   ofbiz/trunk/applications/party/entitydef/entitymodel.xml
>>>   ofbiz/trunk/applications/product/entitydef/entitymodel.xml
>>>
>>> Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=833113&r1=833112&r2=833113&view=diff
>>> = = = = = = = =  
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/applications/party/entitydef/entitymodel.xml  
>>> (original)
>>> +++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Thu  
>>> Nov  5 18:26:27 2009
>>> @@ -1171,7 +1171,7 @@
>>>      <relation type="one" fk-name="POST_ADDR_PCGEO"  
>>> title="PostalCode" rel-entity-name="Geo">
>>>        <key-map field-name="postalCodeGeoId" rel-field-
>>> name="geoId"/>
>>>      </relation>
>>> -      <relation type="one" fk-name="POST_ADDR_GEOPT" title="Geo  
>>> Point" rel-entity-name="GeoPoint">
>>> +      <relation type="many" fk-name="POST_ADDR_GEOPT"  
>>> title="Point"  rel-entity-name="GeoPoint"> <!-- because of the  
>>> elevation field in  GeoPoint we may face a many relationship in  
>>> future -->
>>>        <key-map field-name="geoPointId"/>
>>>      </relation>
>>>      <index name="ADDRESS1_IDX">
>>>
>>> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=833113&r1=833112&r2=833113&view=diff
>>> = = = = = = = =  
>>> =
>>> =
>>> ====================================================================
>>> --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml  
>>> (original)
>>> +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml  
>>> Thu  Nov  5 18:26:27 2009
>>> @@ -1026,7 +1026,7 @@
>>>        <relation type="many" rel-entity-name="FacilityTypeAttr">
>>>            <key-map field-name="facilityTypeId"/>
>>>        </relation>
>>> -        <relation type="one" fk-name="FACILITY_GEOPT" title="Geo  
>>> Point" rel-entity-name="GeoPoint">
>>> +        <relation type="one" fk-name="FACILITY_GEOPT"  
>>> title="Point"  rel-entity-name="GeoPoint">
>>>          <key-map field-name="geoPointId"/>
>>>        </relation>
>>>    </entity>
>>>
>>>
>>
>
>


smime.p7s (4K) Download Attachment