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

com.github.gentity.test.test0c_basic_table_autoincrement.Person Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version

package com.github.gentity.test.test0c_basic_table_autoincrement;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "PERSON")
public class Person implements Serializable
{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    protected Long id;
    @Column(name = "FIRSTNAME", length = 100, nullable = false)
    protected String firstname;
    @Column(name = "SURNAME", length = 100, nullable = false)
    protected String surname;

    public static Person.Builder builder() {
        return new Person.Builder();
    }

    public Long getId() {
        return id;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public static class Builder {

        private final Person instance = new Person();

        public Person build() {
            return instance;
        }

        public Person.Builder firstname(String firstname) {
            instance.firstname = firstname;
            return this;
        }

        public Person.Builder surname(String surname) {
            instance.surname = surname;
            return this;
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy