package com.github.sociallabel.repository;


import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.github.sociallabel.entity.User;


public interface UserRepository extends JpaRepository<User, String>{
	
	List<User> findByEmail(String email);
	
	List<User> findByUsername(String username);
	
	@Query(" from User t where t.following.id = ?1 ")
	List<User> findBySourceId(String userId);

	@Query(" from User t where t.followers.id = ?1 ")
	List<User> findByTagetId(String userId);

//	@SuppressWarnings("rawtypes")
//	List<User> findByUserTags(Set UserTags);
//	

	
}

@@ -414,37 +414,42 @@
 y(%22 from User t 
-where
+inner join
  t.following.id 
@@ -444,16 +444,42 @@
 ollowing
+ as ur where ur.sourceUser
 .id = ?1
@@ -555,25 +555,56 @@
 r t 
-where t.followers
+inner join t.following as ur where ur.targetUser
 .id 

fix an isssue