package com.infinite.focus.server.fcm;


import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;

import com.infinite.focus.server.auth.Student;
import com.infinite.focus.server.fcm.model.PushNotification;


/**
 * 
 * @author Saboor
 * 
 *
 */

@Entity
public class StudentPushNotification {
	
	//PK
 	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long student_push_notification_id;
 	
 	private long student_id;
 	
 	private long push_notification_id;
 	
 	@CreationTimestamp
	public Date createdAt;
 	
 	/*@OneToOne(targetEntity = Student.class, fetch = FetchType.EAGER)
    @JoinColumn(nullable = false, name = "student_id")
    private Student student;*/
 	 	 	 		
 	@OneToOne(targetEntity = PushNotification.class, fetch = FetchType.EAGER)
    @JoinColumn(nullable = false, name = "push_notification_id", insertable = false, updatable = false)
    private PushNotification push_notification;
 	
	public StudentPushNotification() {
		super();
	}

	public long getStudent_push_notification_id() {
		return student_push_notification_id;
	}

	public void setStudent_push_notification_id(long student_push_notification_id) {
		this.student_push_notification_id = student_push_notification_id;
	}

	public long getStudent_id() {
		return student_id;
	}

	public void setStudent_id(long student_id) {
		this.student_id = student_id;
	}

	public long getPush_notification_id() {
		return push_notification_id;
	}

	public void setPush_notification_id(long push_notification_id) {
		this.push_notification_id = push_notification_id;
	}
	
	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}
	
	/*public void setStudent(Student student) {
		this.student = student;
	}
	
	public Student getStudent() {
		return student;
	}*/
	
	public void setPush_notification(PushNotification pushNotification) {
		this.push_notification = push_notification;
	}
	
	public PushNotification getPush_notification() {
		return push_notification;
	}
}