// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/repo/MemberRepository.java
// @Repository
// @Transactional
// public interface MemberRepository extends JpaRepository<Member, Integer> {
// 
//     @Query("select m from Member m where m.rtcId = :rtcId and m.connected = (select max(mm.connected) from Member mm where mm.rtcId = m.rtcId)")
//     Optional<Member> findByRtcId(@Param("rtcId") String rtcId);
// 
//     @Query("select m from Member m where m.rtcId = :rtcId and m.connected = (select max(mm.connected) from Member mm where mm.rtcId = m.rtcId)")
//     Member getByRtcId(@Param("rtcId") String rtcId);
// 
// }


import org.nextrtc.examples.videochat_with_rest.repo.MemberRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
package org.nextrtc.examples.videochat_with_rest.service;



@Service
@Transactional
public class SessionClosedService {

    @Autowired
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/repo/MemberRepository.java
// @Repository
// @Transactional
// public interface MemberRepository extends JpaRepository<Member, Integer> {
// 
//     @Query("select m from Member m where m.rtcId = :rtcId and m.connected = (select max(mm.connected) from Member mm where mm.rtcId = m.rtcId)")
//     Optional<Member> findByRtcId(@Param("rtcId") String rtcId);
// 
//     @Query("select m from Member m where m.rtcId = :rtcId and m.connected = (select max(mm.connected) from Member mm where mm.rtcId = m.rtcId)")
//     Member getByRtcId(@Param("rtcId") String rtcId);
// 
// }


// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/service/SessionClosedService.java
import org.nextrtc.examples.videochat_with_rest.repo.MemberRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;

package org.nextrtc.examples.videochat_with_rest.service;



@Service
@Transactional
public class SessionClosedService {

    @Autowired
    private MemberRepository memberRepository;