A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
617 B

  1. package org.ros.chatto.repository;
  2. import java.util.List;
  3. import org.ros.chatto.model.UserSession;
  4. import org.springframework.data.jpa.repository.JpaRepository;
  5. import org.springframework.data.jpa.repository.Query;
  6. import org.springframework.stereotype.Repository;
  7. @Repository
  8. public interface UserSessionRepository extends JpaRepository<UserSession, Long> {
  9. @Query("select us from UserSession us join fetch us.user where us.user.userName = ?1 ")
  10. public UserSession findByUserName(String userName);
  11. @Query("select us from UserSession us join fetch us.user")
  12. public List<UserSession> findAllUserSessions();
  13. }