// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/Conversation.java
// @Entity
// @Table(name = "Conversations")
// public class Conversation {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.AUTO)
//     @Column(name = "conversation_id")
//     private int id;
// 
//     @Column(name = "conversation_name")
//     private String conversationName;
// 
//     @Column(name = "created")
//     private Date created;
// 
//     @Column(name = "destroyed")
//     private Date destroyed;
// 
//     @OneToMany(mappedBy = "conversation", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
//     private Set<Connection> connections;
// 
//     @Deprecated
//     Conversation() {
//     }
// 
//     public Conversation(String conversationName) {
//         this.conversationName = conversationName;
//         created = now().toDate();
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("(%s)[%s - %s]", conversationName, created, destroyed);
//     }
// 
//     public void destroy() {
//         destroyed = now().toDate();
//         connections.stream()
//                 .filter(Connection::isClosed)
//                 .forEach(Connection::close);
//     }
// 
//     public void join(Member member) {
//         connections.add(new Connection(this, member));
//     }
// 
//     public boolean equals(Object o) {
//         if (o == this) return true;
//         if (!(o instanceof Conversation)) return false;
//         final Conversation other = (Conversation) o;
//         return other.id == id;
//     }
// 
//     public int hashCode() {
//         return id;
//     }
// 
//     public Set<Connection> getConnections() {
//         return connections;
//     }
// }


import org.nextrtc.examples.videochat_with_rest.domain.Conversation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
package org.nextrtc.examples.videochat_with_rest.repo;


@Repository
@Transactional
// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/domain/Conversation.java
// @Entity
// @Table(name = "Conversations")
// public class Conversation {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.AUTO)
//     @Column(name = "conversation_id")
//     private int id;
// 
//     @Column(name = "conversation_name")
//     private String conversationName;
// 
//     @Column(name = "created")
//     private Date created;
// 
//     @Column(name = "destroyed")
//     private Date destroyed;
// 
//     @OneToMany(mappedBy = "conversation", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
//     private Set<Connection> connections;
// 
//     @Deprecated
//     Conversation() {
//     }
// 
//     public Conversation(String conversationName) {
//         this.conversationName = conversationName;
//         created = now().toDate();
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("(%s)[%s - %s]", conversationName, created, destroyed);
//     }
// 
//     public void destroy() {
//         destroyed = now().toDate();
//         connections.stream()
//                 .filter(Connection::isClosed)
//                 .forEach(Connection::close);
//     }
// 
//     public void join(Member member) {
//         connections.add(new Connection(this, member));
//     }
// 
//     public boolean equals(Object o) {
//         if (o == this) return true;
//         if (!(o instanceof Conversation)) return false;
//         final Conversation other = (Conversation) o;
//         return other.id == id;
//     }
// 
//     public int hashCode() {
//         return id;
//     }
// 
//     public Set<Connection> getConnections() {
//         return connections;
//     }
// }


// Path: src/main/java/org/nextrtc/examples/videochat_with_rest/repo/ConversationRepository.java
import org.nextrtc.examples.videochat_with_rest.domain.Conversation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

package org.nextrtc.examples.videochat_with_rest.repo;


@Repository
@Transactional
public interface ConversationRepository extends JpaRepository<Conversation, Integer> {