Skip to content

Commit

Permalink
Add repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksii-yavtushenko committed Apr 17, 2021
1 parent 6b05de8 commit 969cc0d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.letter.server.dao.repository;

import com.letter.server.dao.entity.MessageEntity;
import com.letter.server.dao.entity.UserEntity;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface MessageRepository extends CrudRepository<MessageEntity, Long> {

List<MessageEntity> findAllBySenderAndRecipient(UserEntity sender, UserEntity recipient);

List<MessageEntity> findAllBySenderInAndRecipientIn(UserEntity sender, UserEntity recipient);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.letter.server.dao.repository;

import com.letter.server.dao.entity.OnlineStatusEntity;
import org.springframework.data.repository.CrudRepository;

public interface OnlineStatusRepository extends CrudRepository<OnlineStatusEntity, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.letter.server.dao.repository;

import com.letter.server.dao.entity.UserEntity;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends CrudRepository<UserEntity, Long> {

}

0 comments on commit 969cc0d

Please sign in to comment.