Guest User

Untitled

a guest
Apr 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. package rc;
  2.  
  3. import org.springframework.data.annotation.Id;
  4. import org.springframework.data.mongodb.core.index.IndexDirection;
  5. import org.springframework.data.mongodb.core.index.Indexed;
  6. import org.springframework.data.mongodb.core.mapping.Document;
  7.  
  8. import java.util.ArrayList;
  9. import java.util.List;
  10.  
  11. @Document(collection = "Hotels")
  12. public class Hotel {
  13. @Id
  14. private String id;
  15. private String name;
  16. @Indexed(direction = IndexDirection.ASCENDING)
  17. private int pricePerNight;
  18. private Address address;
  19. private List<Review> reviews;
  20.  
  21. protected Hotel() {
  22. this.reviews = new ArrayList<>();
  23. }
  24.  
  25. public Hotel(String name, int pricePerNight, Address address, List<Review> reviews) {
  26. this.name = name;
  27. this.pricePerNight = pricePerNight;
  28. this.address = address;
  29. this.reviews = reviews;
  30. }
  31.  
  32. public String getId() {
  33. return id;
  34. }
  35.  
  36. public String getName() {
  37. return name;
  38. }
  39.  
  40. public int getPricePerNight() {
  41. return pricePerNight;
  42. }
  43.  
  44. public Address getAddress() {
  45. return address;
  46. }
  47.  
  48. public List<Review> getReviews() {
  49. return reviews;
  50. }
  51. }
Add Comment
Please, Sign In to add comment