/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model.company;

import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import model.AbstractEntity;
import model.adresses.LocationAddress;
import model.customer.Customer;
import model.machine.Machine;
/**
 *
 * @author patri
 */
@Entity
public class Location extends AbstractEntity{
    
    @ManyToOne
    private Company company;
    
    @OneToOne
    private LocationAddress address;
    
    @OneToMany(mappedBy = "location")
    private Set<Machine> machines;
    
    @ManyToMany
    private Set<Customer> contacts;

    public Location() {
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public LocationAddress getAddress() {
        return address;
    }

    public void setAddress(LocationAddress address) {
        this.address = address;
    }

    public Set<Machine> getMachines() {
        return machines;
    }

    public void setMachines(Set<Machine> machines) {
        this.machines = machines;
    }

    public Set<Customer> getContacts() {
        return contacts;
    }

    public void setContacts(Set<Customer> contacts) {
        this.contacts = contacts;
    }
    
    
}
