package com.yihu.hos.standard.service.bo;

import com.yihu.hos.common.ObjectVersion;

public class StandardVersion {
    public final static String VersionBoundSymbol = "_";
    public final static String DataSetTable = "std_dataset";
    public final static String MetaDataTable = "std_metadata";
    public final static String DictTable = "std_dictionary";
    public final static String DictEntryTable = "std_dictionary_entry";
    public final static String CDADocumentTable = "std_cda_document";
    public final static String CDADatasetTable = "std_cda_dataset";

    private ObjectVersion version;

    public StandardVersion(String version) {
        this.version = new ObjectVersion(version);
    }

    public StandardVersion() {

    }

    public static StandardVersion generateVersion() {
        ObjectVersion objectVersion = new ObjectVersion();

        return new StandardVersion(objectVersion.toString());
    }

    public String getDataSetTableName() {
        return DataSetTable + VersionBoundSymbol + version;
    }

    public String getMetaDataTableName() {
        return MetaDataTable + VersionBoundSymbol + version;
    }

    public String getDictTableName() {
        return DictTable + VersionBoundSymbol + version;
    }

    public String getDictEntryTableName() {
        return DictEntryTable + VersionBoundSymbol + version;
    }

    public String getCDATableName() {
        return CDADocumentTable + VersionBoundSymbol + version;
    }

    public String getCDADatasetTableName() {
        return CDADatasetTable + VersionBoundSymbol + version;
    }

    public String getVersion() {
        return version.toString();
    }

    public void finalize() throws Throwable {
    }
}