com.github.gentity.test.test3.User Maven / Gradle / Ivy
package com.github.gentity.test.test3;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "USER")
public class User implements Serializable
{
@Id
@Column(name = "ID")
protected Integer id;
@Column(name = "NAME", length = 100)
protected String name;
@ManyToOne
@JoinColumn(name = "CUSTOMER_ID")
protected Customer customer;
public static User.Builder builder() {
return new User.Builder();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Customer getCustomer() {
return customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
public static class Builder {
private final User instance = new User();
public User build() {
return instance;
}
public User.Builder id(Integer id) {
instance.id = id;
return this;
}
public User.Builder name(String name) {
instance.name = name;
return this;
}
public User.Builder customer(Customer customer) {
instance.customer = customer;
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy