package bg.car_wash.areas.car.entity;

import bg.car_wash.areas.customer.entity.Customer;

import javax.persistence.*;
import javax.validation.constraints.Size;

@Entity
@Table(name = "cars")
public class Car {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	@Column(name = "car_registration_number", nullable = false)
	@Size(min = 8, max = 10)
	private String carRegistrationNumber;

	@Column(name = "car_model_name", nullable = false)
	@Size(min = 2, max = 25)
	private String carModelName;

	@Column(name = "car_make", nullable = false)
	@Size(min = 2, max = 25)
	private String carMake;

	@Enumerated(EnumType.STRING)
	@Column(name = "car_type")
	private CarType carType;

	@ManyToOne(cascade = CascadeType.ALL, targetEntity = Customer.class)
	private Customer owner;

	public Car() {
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCarRegistrationNumber() {
		return carRegistrationNumber;
	}

	public void setCarRegistrationNumber(String carRegistrationNumber) {
		this.carRegistrationNumber = carRegistrationNumber;
	}

	public String getCarModelName() {
		return carModelName;
	}

	public void setCarModelName(String carModelName) {
		this.carModelName = carModelName;
	}

	public String getCarMake() {
		return carMake;
	}

	public void setCarMake(String carMake) {
		this.carMake = carMake;
	}

	public CarType getCarType() {
		return carType;
	}

	public void setCarType(CarType carType) {
		this.carType = carType;
	}

	public Customer getOwner() {
		return owner;
	}

	public void setOwner(Customer owner) {
		this.owner = owner;
	}
}

@@ -475,34 +475,34 @@
 (min = 2, max = 
-25
+40
 )%0A%09private Strin
@@ -577,25 +577,25 @@
 e(min = 
-2
+1
 , max = 
 25)%0A%09pri
@@ -590,10 +590,10 @@
 x = 
-25
+40
 )%0A%09p

change size from 25 to 40