package com.entities;

import java.util.ArrayList;
import java.util.List;

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

@Entity
public class Categories {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int categoriesId;
	private String categoriesTitle;
	
	@OneToMany(mappedBy = "categories")
	private List<Category>category = new ArrayList<>();
	
	public Categories(int categoriesId, String categoriesTitle) {
		super();
		this.categoriesId = categoriesId;
		this.categoriesTitle = categoriesTitle;
	}
	public Categories(String categoriesTitle, List<Category>category) {
		super();
		this.categoriesTitle = categoriesTitle;
		this.category = category;
	}
	public Categories() {
		super();
	}
	public int getCategoriesId() {
		return categoriesId;
	}
	public void setCategoriesId(int categoriesId) {
		this.categoriesId = categoriesId;
	}
	public String getCategoriesTitle() {
		return categoriesTitle;
	}
	public void setCategoriesTitle(String categoriesTitle) {
		this.categoriesTitle = categoriesTitle;
	}
	
	
	public List<Category> getCategory() {
		return category;
	}
	public void setCategory(List<Category> category) {
		this.category = category;
	}
	@Override
	public String toString() {
		return "Categories [categoriesId=" + categoriesId + ", categoriesTitle=" + categoriesTitle + "]";
	}
	
	
	
	
	

}
