001/*
002 * (C) Copyright 2017 Nuxeo (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Funsho David
018 *
019 */
020
021package org.nuxeo.ecm.directory.sql;
022
023import org.nuxeo.common.xmap.annotation.XNode;
024import org.nuxeo.common.xmap.annotation.XObject;
025import org.nuxeo.ecm.directory.ReferenceDescriptor;
026
027/**
028 * Descriptor for SQL directory reference. Present for backward compatibility, use
029 * {@link ReferenceDescriptor} instead.
030 *
031 * @since 9.2
032 */
033@XObject("tableReference")
034public class TableReferenceDescriptor implements Cloneable {
035
036    @XNode("@table")
037    protected String tableName;
038
039    @XNode("@sourceColumn")
040    protected String sourceColumn;
041
042    @XNode("@targetColumn")
043    protected String targetColumn;
044
045    @XNode("@dataFile")
046    protected String dataFileName;
047
048    @XNode("@field")
049    protected String fieldName;
050
051    @XNode("@directory")
052    protected String targetDirectoryName;
053
054    public String getTableName() {
055        return tableName;
056    }
057
058    public void setTableName(String tableName) {
059        this.tableName = tableName;
060    }
061
062    public String getSourceColumn() {
063        return sourceColumn;
064    }
065
066    public void setSourceColumn(String sourceColumn) {
067        this.sourceColumn = sourceColumn;
068    }
069
070    public String getTargetColumn() {
071        return targetColumn;
072    }
073
074    public void setTargetColumn(String targetColumn) {
075        this.targetColumn = targetColumn;
076    }
077
078    public String getDataFileName() {
079        return dataFileName;
080    }
081
082    public void setDataFileName(String dataFileName) {
083        this.dataFileName = dataFileName;
084    }
085
086    public String getFieldName() {
087        return fieldName;
088    }
089
090    public void setFieldName(String fieldName) {
091        this.fieldName = fieldName;
092    }
093
094    public String getTargetDirectoryName() {
095        return targetDirectoryName;
096    }
097
098    public void setTargetDirectoryName(String targetDirectoryName) {
099        this.targetDirectoryName = targetDirectoryName;
100    }
101
102    @Override
103    public TableReferenceDescriptor clone() {
104        try {
105            return (TableReferenceDescriptor) super.clone();
106        } catch (CloneNotSupportedException e) {
107            throw new AssertionError(e);
108        }
109    }
110
111}