Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Notice the @Transient annotation on the MultipartFile field.
- This means that the field value will NOT be persisted to the database.
- */
- package com.teamtreehouse.giflib.model;
- import org.springframework.web.multipart.MultipartFile;
- import javax.persistence.*;
- import java.time.LocalDateTime;
- import java.time.temporal.ChronoUnit;
- @Entity
- public class Gif {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long id;
- @Lob
- private byte[] bytes;
- @Transient
- private MultipartFile file;
- private String description;
- @ManyToOne
- private Category category;
- private LocalDateTime dateUploaded = LocalDateTime.now();
- private String username = "You";
- private boolean favorite;
- private String hash;
- public Gif(){}
- /* Getters, setters, and unrelated methods omitted for brevity */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement