/*
 * Copyright (C) 2016-2020 the original author or authors. 
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.viglet.shio.persistence.model.provider;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.NamedQuery;

import lombok.Setter;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UuidGenerator;

/**
 * The persistent class for the ShProviderInstance database table.
 * 
 * @author Alexandre Oliveira
 * @since 0.3.6
 */
@Setter
@Entity
@NamedQuery(name = "ShProviderInstance.findAll", query = "SELECT pi FROM ShProviderInstance pi")
public class ShProviderInstance {

	@Id
	@UuidGenerator
	@Column(name = "id", updatable = false, nullable = false)
	private String id;

	private String name;

	private String description;

	private int position;

	@ManyToOne
	@JoinColumn(name = "vendor_id")
	@Fetch(org.hibernate.annotations.FetchMode.JOIN)
	private ShProviderVendor vendor;

	private boolean enabled;

	public String getId() {
		return id;
	}

    public String getName() {
		return name;
	}

    public String getDescription() {
		return description;
	}

    public ShProviderVendor getVendor() {
		return vendor;
	}

    public int getPosition() {
		return position;
	}

    public boolean getEnabled() {
		return enabled;
	}

}
