getAllUserCollections

@Query(value = ""SELECT c.* FROM " + COLLECTIONS_KEY + " as c WHERE c." + OWNER_KEY + "=:" + USER_IDENTIFIER_KEY + " UNION " + "SELECT c.* FROM " + COLLECTIONS_KEY + " as c INNER JOIN " + COLLECTIONS_TEAMS_TABLE + " ON c." + IDENTIFIER_KEY + " = " + COLLECTIONS_TEAMS_TABLE + "." + COLLECTION_IDENTIFIER_KEY + " INNER JOIN " + MEMBERS_KEY + " ON " + MEMBERS_KEY + "." + TEAM_IDENTIFIER_KEY + " WHERE " + MEMBERS_KEY + "." + OWNER_KEY + "=:" + USER_IDENTIFIER_KEY", nativeQuery = true)
abstract fun getAllUserCollections(@Param(value = "user_id") userId: String): List<LinksCollection>

Method to execute the query to get all the user's collections, included the collections shared in the teams

Return

the user collections as List of LinksCollection

Parameters

userId

: the identifier of the user