package org.mhshams.domain;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * The car model.
 */
@EqualsAndHashCode(of = {"id", "model"})
@ToString(of = {"id", "model"})
@Entity(name = "t_models")
public class Model extends AbstractEntity {
    private static final long serialVersionUID = 3L;

    @Getter
    @Column(name = "c_model", nullable = false)
    private String model;

    @Getter
    @ManyToOne(optional = false)
    @JoinColumn(name = "c_make_id", nullable = false)
    private Make make;
}
