package com.tymiller.model;

import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import org.hibernate.annotations.CreationTimestamp;

import com.fasterxml.jackson.annotation.JsonBackReference;

@Entity
public class Photo {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long photoId;
	private String photoName;
	private String title;
	private String description;
	private String imageName;
	
	@CreationTimestamp
	private Date created;
	
	@ManyToOne
	@JsonBackReference
	private User user;
	
	private int likes;
	
	@OneToMany(mappedBy = "photo", fetch=FetchType.EAGER)
	private List<Comment> commentList;
}

@@ -861,11 +861,1157 @@
 entList;
+%0A%0A%09public Long getPhotoId() %7B%0A%09%09return photoId;%0A%09%7D%0A%0A%09public void setPhotoId(Long photoId) %7B%0A%09%09this.photoId = photoId;%0A%09%7D%0A%0A%09public String getPhotoName() %7B%0A%09%09return photoName;%0A%09%7D%0A%0A%09public void setPhotoName(String photoName) %7B%0A%09%09this.photoName = photoName;%0A%09%7D%0A%0A%09public String getTitle() %7B%0A%09%09return title;%0A%09%7D%0A%0A%09public void setTitle(String title) %7B%0A%09%09this.title = title;%0A%09%7D%0A%0A%09public String getDescription() %7B%0A%09%09return description;%0A%09%7D%0A%0A%09public void setDescription(String description) %7B%0A%09%09this.description = description;%0A%09%7D%0A%0A%09public String getImageName() %7B%0A%09%09return imageName;%0A%09%7D%0A%0A%09public void setImageName(String imageName) %7B%0A%09%09this.imageName = imageName;%0A%09%7D%0A%0A%09public Date getCreated() %7B%0A%09%09return created;%0A%09%7D%0A%0A%09public void setCreated(Date created) %7B%0A%09%09this.created = created;%0A%09%7D%0A%0A%09public User getUser() %7B%0A%09%09return user;%0A%09%7D%0A%0A%09public void setUser(User user) %7B%0A%09%09this.user = user;%0A%09%7D%0A%0A%09public int getLikes() %7B%0A%09%09return likes;%0A%09%7D%0A%0A%09public void setLikes(int likes) %7B%0A%09%09this.likes = likes;%0A%09%7D%0A%0A%09public List%3CComment%3E getCommentList() %7B%0A%09%09return commentList;%0A%09%7D%0A%0A%09public void setCommentList(List%3CComment%3E commentList) %7B%0A%09%09this.commentList = commentList;%0A%09%7D%0A%09%0A%09
 %0A%7D%0A

add getters and setters for fields