com.github.gentity.test.test0f_basic_table_enumerated.Movie Maven / Gradle / Ivy
package com.github.gentity.test.test0f_basic_table_enumerated;
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.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.github.gentity.test.test0e_basic_table_enumerated.MovieGenre;
import com.github.gentity.test.test0e_basic_table_enumerated.MovieRating;
@Entity
@Table(name = "MOVIE")
public class Movie implements Serializable
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
protected Integer id;
@Column(name = "NAME", length = 100, nullable = false)
protected String name;
@Enumerated(EnumType.ORDINAL)
@Column(name = "RATING", nullable = false)
protected MovieRating rating;
@Enumerated(EnumType.STRING)
@Column(name = "GENRE", nullable = false)
protected MovieGenre genre;
public static Movie.Builder builder() {
return new Movie.Builder();
}
public Integer getId() {
return id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public MovieRating getRating() {
return rating;
}
public void setRating(MovieRating rating) {
this.rating = rating;
}
public MovieGenre getGenre() {
return genre;
}
public void setGenre(MovieGenre genre) {
this.genre = genre;
}
public static class Builder {
private final Movie instance = new Movie();
public Movie build() {
return instance;
}
public Movie.Builder name(String name) {
instance.name = name;
return this;
}
public Movie.Builder rating(MovieRating rating) {
instance.rating = rating;
return this;
}
public Movie.Builder genre(MovieGenre genre) {
instance.genre = genre;
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy