Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. /*
  2. Notice the @Transient annotation on the MultipartFile field.
  3. This means that the field value will NOT be persisted to the database.
  4. */
  5.  
  6. package com.teamtreehouse.giflib.model;
  7.  
  8. import org.springframework.web.multipart.MultipartFile;
  9.  
  10. import javax.persistence.*;
  11. import java.time.LocalDateTime;
  12. import java.time.temporal.ChronoUnit;
  13.  
  14. @Entity
  15. public class Gif {
  16.  
  17. @Id
  18. @GeneratedValue(strategy = GenerationType.IDENTITY)
  19. private Long id;
  20.  
  21. @Lob
  22. private byte[] bytes;
  23.  
  24. @Transient
  25. private MultipartFile file;
  26.  
  27. private String description;
  28.  
  29. @ManyToOne
  30. private Category category;
  31.  
  32. private LocalDateTime dateUploaded = LocalDateTime.now();
  33.  
  34. private String username = "You";
  35.  
  36. private boolean favorite;
  37.  
  38. private String hash;
  39.  
  40. public Gif(){}
  41.  
  42. /* Getters, setters, and unrelated methods omitted for brevity */
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement