feat(stammbaum): family network — graph, badge, edit card, /stammbaum page (#358) #360
@@ -16,7 +16,11 @@ public interface PersonRelationshipRepository extends JpaRepository<PersonRelati
|
|||||||
* Bulk fetch for the network endpoint — pulls only edges of the given types.
|
* Bulk fetch for the network endpoint — pulls only edges of the given types.
|
||||||
* The service filters by family_member afterwards.
|
* The service filters by family_member afterwards.
|
||||||
*/
|
*/
|
||||||
List<PersonRelationship> findAllByRelationTypeIn(Collection<RelationType> types);
|
@Query("SELECT r FROM PersonRelationship r " +
|
||||||
|
"JOIN FETCH r.person " +
|
||||||
|
"JOIN FETCH r.relatedPerson " +
|
||||||
|
"WHERE r.relationType IN :types")
|
||||||
|
List<PersonRelationship> findAllByRelationTypeIn(@Param("types") Collection<RelationType> types);
|
||||||
|
|
||||||
/** Used for the circular-PARENT_OF check in {@code addRelationship}. */
|
/** Used for the circular-PARENT_OF check in {@code addRelationship}. */
|
||||||
boolean existsByPersonIdAndRelatedPersonIdAndRelationType(
|
boolean existsByPersonIdAndRelatedPersonIdAndRelationType(
|
||||||
@@ -38,6 +42,8 @@ public interface PersonRelationshipRepository extends JpaRepository<PersonRelati
|
|||||||
* Used by the "direct relationships" listings (person edit, side panel).
|
* Used by the "direct relationships" listings (person edit, side panel).
|
||||||
*/
|
*/
|
||||||
@Query("SELECT r FROM PersonRelationship r " +
|
@Query("SELECT r FROM PersonRelationship r " +
|
||||||
|
"JOIN FETCH r.person " +
|
||||||
|
"JOIN FETCH r.relatedPerson " +
|
||||||
"WHERE r.person.id = :personId OR r.relatedPerson.id = :personId")
|
"WHERE r.person.id = :personId OR r.relatedPerson.id = :personId")
|
||||||
List<PersonRelationship> findAllByPersonIdOrRelatedPersonId(@Param("personId") UUID personId);
|
List<PersonRelationship> findAllByPersonIdOrRelatedPersonId(@Param("personId") UUID personId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user