package bj.pranie.dao;

import bj.pranie.entity.User;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by noon on 10.08.16.
 */
@Transactional
public interface UserDao extends CrudRepository<User, Long> {
    User findByEmail(String email);

    User findByUsername(String username);


}

package bj.pranie.dao;

import bj.pranie.entity.Room;
import bj.pranie.entity.User;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by noon on 10.08.16.
 */
@Transactional
public interface UserDao extends CrudRepository<User, Long> {
    User findByEmail(String email);

    User findByUsername(String username);

    List<User> findByRoom(Room room);
}

Add method to find user by room to UserDao.