package com.qxgmat.data.dao.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "flyway_schema_history")
public class FlywaySchemaHistory implements Serializable {
    @Id
    @Column(name = "`installed_rank`")
    private Integer installedRank;

    @Column(name = "`version`")
    private String version;

    @Column(name = "`description`")
    private String description;

    @Column(name = "`type`")
    private String type;

    @Column(name = "`script`")
    private String script;

    @Column(name = "`checksum`")
    private Integer checksum;

    @Column(name = "`installed_by`")
    private String installedBy;

    @Column(name = "`installed_on`")
    private Date installedOn;

    @Column(name = "`execution_time`")
    private Integer executionTime;

    @Column(name = "`success`")
    private Integer success;

    private static final long serialVersionUID = 1L;

    /**
     * @return installed_rank
     */
    public Integer getInstalledRank() {
        return installedRank;
    }

    /**
     * @param installedRank
     */
    public void setInstalledRank(Integer installedRank) {
        this.installedRank = installedRank;
    }

    /**
     * @return version
     */
    public String getVersion() {
        return version;
    }

    /**
     * @param version
     */
    public void setVersion(String version) {
        this.version = version;
    }

    /**
     * @return description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param description
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return type
     */
    public String getType() {
        return type;
    }

    /**
     * @param type
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * @return script
     */
    public String getScript() {
        return script;
    }

    /**
     * @param script
     */
    public void setScript(String script) {
        this.script = script;
    }

    /**
     * @return checksum
     */
    public Integer getChecksum() {
        return checksum;
    }

    /**
     * @param checksum
     */
    public void setChecksum(Integer checksum) {
        this.checksum = checksum;
    }

    /**
     * @return installed_by
     */
    public String getInstalledBy() {
        return installedBy;
    }

    /**
     * @param installedBy
     */
    public void setInstalledBy(String installedBy) {
        this.installedBy = installedBy;
    }

    /**
     * @return installed_on
     */
    public Date getInstalledOn() {
        return installedOn;
    }

    /**
     * @param installedOn
     */
    public void setInstalledOn(Date installedOn) {
        this.installedOn = installedOn;
    }

    /**
     * @return execution_time
     */
    public Integer getExecutionTime() {
        return executionTime;
    }

    /**
     * @param executionTime
     */
    public void setExecutionTime(Integer executionTime) {
        this.executionTime = executionTime;
    }

    /**
     * @return success
     */
    public Integer getSuccess() {
        return success;
    }

    /**
     * @param success
     */
    public void setSuccess(Integer success) {
        this.success = success;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", installedRank=").append(installedRank);
        sb.append(", version=").append(version);
        sb.append(", description=").append(description);
        sb.append(", type=").append(type);
        sb.append(", script=").append(script);
        sb.append(", checksum=").append(checksum);
        sb.append(", installedBy=").append(installedBy);
        sb.append(", installedOn=").append(installedOn);
        sb.append(", executionTime=").append(executionTime);
        sb.append(", success=").append(success);
        sb.append("]");
        return sb.toString();
    }

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

    public static class Builder {
        private FlywaySchemaHistory obj;

        public Builder() {
            this.obj = new FlywaySchemaHistory();
        }

        /**
         * @param installedRank
         */
        public Builder installedRank(Integer installedRank) {
            obj.setInstalledRank(installedRank);
            return this;
        }

        /**
         * @param version
         */
        public Builder version(String version) {
            obj.setVersion(version);
            return this;
        }

        /**
         * @param description
         */
        public Builder description(String description) {
            obj.setDescription(description);
            return this;
        }

        /**
         * @param type
         */
        public Builder type(String type) {
            obj.setType(type);
            return this;
        }

        /**
         * @param script
         */
        public Builder script(String script) {
            obj.setScript(script);
            return this;
        }

        /**
         * @param checksum
         */
        public Builder checksum(Integer checksum) {
            obj.setChecksum(checksum);
            return this;
        }

        /**
         * @param installedBy
         */
        public Builder installedBy(String installedBy) {
            obj.setInstalledBy(installedBy);
            return this;
        }

        /**
         * @param installedOn
         */
        public Builder installedOn(Date installedOn) {
            obj.setInstalledOn(installedOn);
            return this;
        }

        /**
         * @param executionTime
         */
        public Builder executionTime(Integer executionTime) {
            obj.setExecutionTime(executionTime);
            return this;
        }

        /**
         * @param success
         */
        public Builder success(Integer success) {
            obj.setSuccess(success);
            return this;
        }

        public FlywaySchemaHistory build() {
            return this.obj;
        }
    }
}