We're updating the issue view to help you get more done. 

New API for working with connections (predicates) between entities

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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); }

Environment

None

Status

Assignee

Sergiu Dumitriu

Reporter

Sergiu Dumitriu

Labels

None

External issue ID

None

External issue ID

None

Components

Fix versions

Priority

Medium