001    package org.apache.ojb.broker.metadata.torque;
002    
003    /* Copyright 2002-2005 The Apache Software Foundation
004     *
005     * Licensed under the Apache License, Version 2.0 (the "License");
006     * you may not use this file except in compliance with the License.
007     * You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    import org.apache.ojb.broker.metadata.FieldDescriptor;
019    
020    import java.util.TreeMap;
021    import java.util.Vector;
022    
023    public class TableDescriptor {
024    
025        private TreeMap columnsMap = new TreeMap();
026        private Vector columns = new Vector();
027        private Vector indices = new Vector();
028        private Vector references = new Vector();
029        private String name;
030    
031        public String getName() {
032            return this.name;
033        }
034    
035        public void setName(String name) {
036            this.name = name;
037        }
038    
039        public Vector getColumns() {
040            return this.columns;
041        }
042    
043        public void addColumn(FieldDescriptor column) {
044            if (!this.columnsMap.containsKey(column.getColumnName())) {
045                this.columnsMap.put(column.getColumnName(), column);
046                this.columns.add(column);
047            }
048        }
049    
050        public Vector getIndices() {
051            return this.indices;
052        }
053    
054        public void setIndices(Vector indices) {
055            this.indices = indices;
056        }
057    
058        public Vector getReferences() {
059            return this.references;
060        }
061    
062        public void setReferences(Vector references) {
063            this.references = references;
064        }
065    
066    }