package com.michaelhoffmantech.recipemanager.recipedataservice.domain;
// Generated Feb 13, 2017 4:02:01 PM by Hibernate Tools 5.2.0.CR1

import java.util.Date;

import javax.persistence.Column;
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.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Recipeattribute generated by hbm2java
 */
@Entity
@Table(name = "recipe_attribute")
public class RecipeAttribute implements java.io.Serializable {

   private static final long serialVersionUID = 7940283521556252203L;

   private Integer recipeAttributeId;
   private Recipe recipe;
   private String attributeName;
   private String attributeValue;
   private String createdBy;
   private Date createdTimestamp;

   public RecipeAttribute() {
   }

   public RecipeAttribute(Integer recipeAttributeId, Recipe recipe, String attributeName,
         String attributeValue, String createdBy, Date createdTimestamp) {
      this.recipeAttributeId = recipeAttributeId;
      this.recipe = recipe;
      this.attributeName = attributeName;
      this.attributeValue = attributeValue;
      this.createdBy = createdBy;
      this.createdTimestamp = createdTimestamp;
   }

   @Id
   @SequenceGenerator(name = "recipe_attribute_recipe_attribute_id_seq",
         sequenceName = "recipe_attribute_recipe_attribute_id_seq", allocationSize = 1)
   @GeneratedValue(strategy = GenerationType.SEQUENCE,
         generator = "recipe_attribute_recipe_attribute_id_seq")
   @Column(name = "recipe_attribute_id", unique = true, nullable = false)
   public Integer getRecipeAttributeId() {
      return this.recipeAttributeId;
   }

   public void setRecipeAttributeId(Integer recipeAttributeId) {
      this.recipeAttributeId = recipeAttributeId;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "recipe_id", nullable = false)
   public Recipe getRecipe() {
      return this.recipe;
   }

   public void setRecipe(Recipe recipe) {
      this.recipe = recipe;
   }

   @Column(name = "attribute_name", nullable = false, length = 250)
   public String getAttributeName() {
      return this.attributeName;
   }

   public void setAttributeName(String attributeName) {
      this.attributeName = attributeName;
   }

   @Column(name = "attribute_value", nullable = false, length = 1000)
   public String getAttributeValue() {
      return this.attributeValue;
   }

   public void setAttributeValue(String attributeValue) {
      this.attributeValue = attributeValue;
   }

   @Column(name = "created_by", nullable = false, length = 100)
   public String getCreatedBy() {
      return this.createdBy;
   }

   public void setCreatedBy(String createdBy) {
      this.createdBy = createdBy;
   }

   @Temporal(TemporalType.TIMESTAMP)
   @Column(name = "created_timestamp", nullable = false, length = 29)
   public Date getCreatedTimestamp() {
      return this.createdTimestamp;
   }

   public void setCreatedTimestamp(Date createdTimestamp) {
      this.createdTimestamp = createdTimestamp;
   }

}
