package com.poc.springredis.domain;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

/**
 * @author Luram Archanjo / 20180820
 */
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Car implements Serializable {

  @Id
  @GeneratedValue(generator = "UUID")
  @GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
  private String id;

  @Column
  private String model;

  @Column
  private Integer year;

  @Enumerated(EnumType.STRING)
  private CarType type;

}
{'avg_line_length': 21.5, 'max_line_length': 79, 'alphanum_fraction': 0.7895348837209303, 'licenses': ['Apache-2.0'], 'repository_name': 'larchanjo/poc-spring-data', 'path': 'src/main/java/com/poc/springredis/domain/Car.java', 'size': 860, 'lang': 'Java'}