Uploaded image for project: 'PhenoTips'
  1. PT-3662

New API for working with connections (predicates) between entities

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Affects versions: None
    • Fix versions: 1.4-milestone-4
    • Components: entities
    • Labels:
      None
    • Sprint:

      Description

      This is a replacement for the Entity Groups APIs:

      • instead of extending the PrimaryEntity interface, enforcing a hard-coded relationship between a group entity and its members, it is an external connection manager
      • each connection manager, or predicate, handles only one type of Subject (what used to be called Group) and Object (what used to be called Member), so multiple types of members can easily be handled, and types of members can be added and removed
      • reverse predicates may be implemented to allow working in either direction, for example a "patient-belongsTo-family" predicate and a "family-contains-patients" predicate
      • a simpler "property" API is also included, for predicates that connect a subject to only one object
      PrimaryEntityConnectionsManager<S, O> {
        boolean connect(S subject, O object);
        boolean connectAll(S subject, Collection<O> objects);
        boolean connectFromAll(Collection<S> subjects, O object);
        boolean disconnect(S subject, O object);
        boolean disconnectAll(S subject, Collection<O> objects);
        boolean disconnectAll(S subject);
        boolean disconnectFromAll(O object);
        Collection<O> getAllConnections(S subject);
        Collection<S> getAllReverseConnections(O object);
        boolean isConnected(S subject, O object);
        
        // Property methods
        O get(S subject);
        boolean set(S subject, O property);
        boolean remove(S subject);
      }
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                sdumitriu Sergiu Dumitriu
                Reporter:
                sdumitriu Sergiu Dumitriu
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: