Skip to content

Commit

Permalink
Merge branch 'Twitter-Clone-Group:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nickchoi10 authored Sep 5, 2022
2 parents 1cb6df5 + 7c788ff commit f066a43
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ public interface SqueakRepository extends JpaRepository<Squeak, Long> {
List<Squeak> findAllBySqueakerOrderById(Squeaker squeaker);

Squeak findSqueakById(Long id);
List<Squeak> findAllByOrderByIdDesc();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ public class Squeaker {
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
Long id;
@Column(name = "username")
@Column(name = "username", unique = true)
String username;
@Column(name = "password")
String password;
@OneToMany(mappedBy = "squeaker")
@JsonIgnore
Set<Squeak> squeaks;
@Column(name = "first_name")
String firstName;
@Column(name = "last_name")
String lastName;
@Column(name = "profile_pic")
String profilePic;
@Column(name = "email", unique = true)
String email;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SqueakService {


public List<Squeak> findAllSqueaks() {
return squeakRepository.findAll();
return squeakRepository.findAllByOrderByIdDesc();
}

public Squeak findSqueakById(Long id) {
Expand Down

0 comments on commit f066a43

Please sign in to comment.