package com.tymiller.model;

import java.util.Date;

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

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;
}

@@ -44,16 +44,39 @@
 il.Date;
+%0Aimport java.util.List;
 %0A%0Aimport
@@ -102,16 +102,52 @@
 Entity;%0A
+import javax.persistence.FetchType;%0A
 import j
@@ -284,16 +284,52 @@
 nyToOne;
+%0Aimport javax.persistence.OneToMany;
 %0A%0Aimport
@@ -747,10 +747,125 @@
 r user;%0A
+%09%0A%09private int likes;%0A%09%0A%09@OneToMany(mappedBy = %22photo%22, fetch=FetchType.EAGER)%0A%09private List%3CComment%3E commentList;%0A
 %7D%0A

add likes, and list of comments