All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.gentity.test.test3.Product Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version

package com.github.gentity.test.test3;

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.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "PRODUCT")
public class Product implements Serializable
{

    @Id
    @Column(name = "ID")
    protected Long id;
    @Column(name = "NAME", length = 100)
    protected String name;
    @ManyToMany(mappedBy = "product")
    protected List customer = new ArrayList();

    public static Product.Builder builder() {
        return new Product.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 getCustomer() {
        return customer;
    }

    public void setCustomer(List customer) {
        this.customer = customer;
    }

    public static class Builder {

        private final Product instance = new Product();

        public Product build() {
            return instance;
        }

        public Product.Builder id(Long id) {
            instance.id = id;
            return this;
        }

        public Product.Builder name(String name) {
            instance.name = name;
            return this;
        }

        public Product.Builder customer(List customer) {
            instance.customer = customer;
            return this;
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy