Interface GroupRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Entity,String>, org.springframework.data.neo4j.repository.Neo4jRepository<Entity,String>, org.springframework.data.repository.PagingAndSortingRepository<Entity,String>, org.springframework.data.repository.query.QueryByExampleExecutor<Entity>, org.springframework.data.repository.Repository<Entity,String>, VRSpaceDB

@DependsOn("database") public interface GroupRepository extends org.springframework.data.neo4j.repository.Neo4jRepository<Entity,String>, VRSpaceDB
  • Method Details

    • listOwnedGroups

      @Query("MATCH (ug:UserGroup)<-[owned:IS_OWNED]-(o:Ownership)-[owns:IS_OWNER]->(c:Client) WHERE c.id = $clientId RETURN o,owns,c,owned,ug ORDER BY ug.name") List<UserGroup> listOwnedGroups(String clientId)
    • listGroupOwners

      @Query("MATCH (ug:UserGroup)<-[owned:IS_OWNED]-(o:Ownership)-[owns:IS_OWNER]->(c:Client) WHERE ug.id = $groupId RETURN o,owns,c,owned,ug") List<Client> listGroupOwners(String groupId)
    • listUserGroups

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE c.id=$clientId AND gm.pendingInvite IS NULL AND gm.pendingRequest IS NULL RETURN ug ORDER BY ug.name") List<UserGroup> listUserGroups(String clientId)
    • listGroupMemberships

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE c.id=$clientId AND gm.pendingInvite IS NULL AND gm.pendingRequest IS NULL RETURN gm, r, ug ORDER BY ug.name") List<GroupMember> listGroupMemberships(String clientId)
    • listGroupClients

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE ug.id=$groupId AND gm.pendingRequest IS NULL AND gm.pendingInvite IS NULL RETURN c") List<Client> listGroupClients(String groupId)
    • listGroupMembers

      @Query("MATCH (gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE ug.id=$groupId AND gm.pendingRequest IS NULL AND gm.pendingInvite IS NULL RETURN gm, r, ug") List<GroupMember> listGroupMembers(String groupId)
    • findGroupMember

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE ug.id=$groupId AND c.id=$clientId RETURN gm, c, mc, r, ug") Optional<GroupMember> findGroupMember(String groupId, String clientId)
    • findGroupByName

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE c.id=$clientId AND ug.name=$groupName RETURN ug") Optional<UserGroup> findGroupByName(String clientId, String groupName)
    • findGroupById

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE c.id=$clientId AND ug.id=$groupId RETURN ug") Optional<UserGroup> findGroupById(String clientId, String groupId)
    • findGroupByName

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE AND ug.name=$groupName RETURN ug") Optional<UserGroup> findGroupByName(String groupName)
    • listPendingRequests

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup) WHERE ug.id=$groupId AND gm.pendingRequest IS NOT NULL RETURN gm, c, mc, r, ug") List<GroupMember> listPendingRequests(String groupId)
    • listPendingInvitations

      @Query("MATCH (c:Client)<-[mc:MEMBER_CLIENT]-(gm:GroupMember)-[r:IS_MEMBER_OF]->(ug:UserGroup), (s:Client)<-[sc:SPONSOR_CLIENT]-(gm:GroupMember) WHERE c.id=$clientId AND gm.pendingInvite IS NOT NULL RETURN gm, c, mc, r, ug, sc, s ORDER BY ug.name") List<GroupMember> listPendingInvitations(String clientId)
    • unreadMessageCount

      @Query("MATCH (msg:GroupMessage)-[r:PARENT_GROUP]->(ug:UserGroup) WHERE ug.id=$groupId AND ($since IS NULL OR msg.timestamp >= $since) return count(msg)") Integer unreadMessageCount(String groupId, Instant since)
    • messagesSince

      @Query("MATCH (c:Client)<-[mc:SENDER_CLIENT]-(msg:GroupMessage)-[r:PARENT_GROUP]->(ug:UserGroup) WHERE ug.id=$groupId AND ($since IS NULL OR msg.timestamp >= $since) return msg, mc, c ORDER BY msg.timestamp") List<GroupMessage> messagesSince(String groupId, Instant since)