package sklep.model;

import java.io.Serializable;
import javax.persistence.*;


/**
 * The persistent class for the photos database table.
 * 
 */
@Entity
@Table(name="photos")
@NamedQuery(name="Photo.findAll", query="SELECT p FROM Photo p")
public class Photo extends AbstractEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private PhotoPK id;

	private byte[] bytes;

	//bi-directional many-to-one association to Product
	@ManyToOne
	@JoinColumn(name="product_id", insertable=false, updatable=false)
	private Product product;

	public Photo() {
	}

	public PhotoPK getId() {
		return this.id;
	}

	public void setId(PhotoPK id) {
		this.id = id;
	}

	public byte[] getBytes() {
		return this.bytes;
	}

	public void setBytes(byte[] bytes) {
		this.bytes = bytes;
	}

	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

}