package com.company.taxi.entity;

import javax.persistence.*;

import com.haulmont.chile.core.annotations.Composition;
import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.annotation.OnDelete;
import com.haulmont.cuba.core.global.DeletePolicy;
import java.util.Set;

@NamePattern("%s|name")
@Table(name = "TAXI_CAR_SERVICE_CENTER")
@Entity(name = "taxi$CarServiceCenter")
public class CarServiceCenter extends StandardEntity {
    private static final long serialVersionUID = 439784043941588873L;

    @Column(name = "NAME", nullable = false)
    protected String name;

    @Column(name = "PHONE")
    protected String phone;

    @Column(name = "ADDRESS")
    protected String address;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CITY_ID")
    protected City city;

    @Composition
    @OnDelete(DeletePolicy.CASCADE)
    @OneToMany(mappedBy = "carcervicecenter")
    protected Set<Employee> emplo;



    public void setEmplo(Set<Employee> emplo) {
        this.emplo = emplo;
    }

    public Set<Employee> getEmplo() {
        return emplo;
    }


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

    public String getAddress() {
        return address;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public City getCity() {
        return city;
    }


    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }


}