com.github.gentity.test.test2.Customer Maven / Gradle / Ivy
package com.github.gentity.test.test2;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "CUSTOMER")
public class Customer implements Serializable
{
@Id
@Column(name = "ID")
protected Long id;
@Column(name = "NAME", length = 100, nullable = false)
protected String name;
@OneToMany(mappedBy = "customer")
protected List user = new ArrayList();
public static Customer.Builder builder() {
return new Customer.Builder();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List getUser() {
return user;
}
public void setUser(List user) {
this.user = user;
}
public static class Builder {
private final Customer instance = new Customer();
public Customer build() {
return instance;
}
public Customer.Builder id(Long id) {
instance.id = id;
return this;
}
public Customer.Builder name(String name) {
instance.name = name;
return this;
}
public Customer.Builder user(List user) {
instance.user = user;
return this;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy