package org.academiadecodigo.enuminatti.hibernatebootstrap.inheritance.singletable;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

@Entity
@DiscriminatorValue("Car")
public class Car extends Vehicle {
    private Integer gears;

    public Car() {
    }

    public Car(Integer maxSpeed, Integer gears) {
        super(maxSpeed);
        this.gears = gears;
    }

    public Integer getGears() {
        return gears;
    }

    public void setGears(Integer gears) {
        this.gears = gears;
    }

    @Override
    public String toString() {
        return "Car{" +
                "gears=" + gears +
                '}';
    }
}
