[GIT] Evergreen ILS branch main updated. 81015760b636b39d759234023a76c351f2d32da5

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, main has been updated via 81015760b636b39d759234023a76c351f2d32da5 (commit) from 79c4070673f0dd8451e01212fbe52dcee076af47 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 81015760b636b39d759234023a76c351f2d32da5 Author: Mike Rylander <mrylander@gmail.com> Date: Mon Apr 28 10:03:58 2025 -0400 LP#1161616: Wrong reltype attributes Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Garry Collum <gcollum@gmail.com> Signed-off-by: Jane Sandberg <js7389@princeton.edu> diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 2581b54d84..ab0aaddf78 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -68,6 +68,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA </class> + ############################################################################### + #### Rules of thumb for using the @reltype attribute on the <link> element #### + ############################################################################### + + * If the field is not virtual, but backed by a real column: use "has_a" + * If the field is virtual, but there's only ever going to be, at most, one row on the other end of the join: use "might_have" + * If the field is virtual, and there can be any number of rows on the other end of the join: use "has_many" + + There are exceptions and deviations from those rules of thumb, especially WRT links through primary keys. Ask on the Evergreen + Developer mailing list, or the #evergreen IRC channel on the Libera network, if you are unsure of which to use. --> <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" xmlns:repsec="http://open-ils.org/spec/opensrf/IDL/reporter/v1/security"> @@ -3004,7 +3014,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA </fields> <links> <link field="record" reltype="has_a" key="id" map="" class="are"/> - <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/> + <link field="thesaurus" reltype="has_a" key="code" map="" class="at"/> </links> </class> <class id="abl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link"> @@ -4259,9 +4269,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA <field name="layout" reporter:label="Layout" reporter:datatype="text" oils_obj:required="true"/> </fields> <links> - <link field="usr" reltype="might_have" key="id" map="" class="au"/> - <link field="org" reltype="might_have" key="id" map="" class="aou"/> - <link field="ws" reltype="might_have" key="id" map="" class="aws"/> + <link field="usr" reltype="has_a" key="id" map="" class="au"/> + <link field="org" reltype="has_a" key="id" map="" class="aou"/> + <link field="ws" reltype="has_a" key="id" map="" class="aws"/> </links> <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <actions> @@ -4731,7 +4741,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA <link field="payment" reltype="might_have" key="id" map="" class="mp"/> <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/> <link field="xact" reltype="has_a" key="id" map="" class="mbt"/> - <link field="billing" reltype="might_have" key="id" map="" class="mb"/> + <link field="billing" reltype="has_a" key="id" map="" class="mb"/> </links> </class> <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor"> @@ -6882,9 +6892,9 @@ SELECT usr, <link field="reset_entries" reltype="has_many" key="hold" map="" class="ahrrre"/> <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/> <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/> - <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/> - <link field="canceled_by" reltype="might_have" key="id" map="" class="au"/> - <link field="canceling_ws" reltype="might_have" key="id" map="" class="aws"/> + <link field="cancel_cause" reltype="has_a" key="id" map="" class="ahrcc"/> + <link field="canceled_by" reltype="has_a" key="id" map="" class="au"/> + <link field="canceling_ws" reltype="has_a" key="id" map="" class="aws"/> <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/> <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/> <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/> @@ -7051,7 +7061,7 @@ SELECT usr, <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/> <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/> <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/> - <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/> + <link field="cancel_cause" reltype="has_a" key="id" map="" class="ahrcc"/> <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/> <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/> <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/> @@ -7123,7 +7133,7 @@ SELECT usr, <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/> <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/> <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/> - <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/> + <link field="cancel_cause" reltype="has_a" key="id" map="" class="ahrcc"/> <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/> <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/> <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/> @@ -7201,7 +7211,7 @@ SELECT usr, <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/> <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/> <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/> - <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/> + <link field="cancel_cause" reltype="has_a" key="id" map="" class="ahrcc"/> <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/> <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/> </links> @@ -7259,7 +7269,7 @@ SELECT usr, <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/> <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/> <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/> - <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/> + <link field="cancel_cause" reltype="has_a" key="id" map="" class="ahrcc"/> <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/> <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/> </links> @@ -15598,7 +15608,7 @@ SELECT usr, <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/> </fields> <links> - <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/> + <link field="floating_id" reltype="has_a" key="id" map="" class="cfg"/> <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/> <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/> <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/> @@ -15928,9 +15938,9 @@ SELECT usr, <links> <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/> <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/> - <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/> - <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/> - <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/> + <link field="circ_modifier_code" reltype="has_a" key="code" map="" class="ccm"/> + <link field="age_protect_id" reltype="has_a" key="id" map="" class="crahp"/> + <link field="inv_workstation_id" reltype="has_a" key="id" map="" class="aws"/> </links> </class> ----------------------------------------------------------------------- Summary of changes: Open-ILS/examples/fm_IDL.xml | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) hooks/post-receive -- Evergreen ILS
participants (1)
-
Git User