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

com.github.gentity.test.test0d_basic_table_blob.Document Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version

package com.github.gentity.test.test0d_basic_table_blob;

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

@Entity
@Table(name = "DOCUMENT")
public class Document implements Serializable
{

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    protected Integer id;
    @Column(name = "NAME", length = 100, nullable = false)
    protected String name;
    @Lob
    @Column(name = "CONTENT", nullable = false)
    protected byte[] content;

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

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    public static class Builder {

        private final Document instance = new Document();

        public Document build() {
            return instance;
        }

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

        public Document.Builder content(byte[] content) {
            instance.content = content;
            return this;
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy