001    /*
002     * JBoss DNA (http://www.jboss.org/dna)
003     * See the COPYRIGHT.txt file distributed with this work for information
004     * regarding copyright ownership.  Some portions may be licensed
005     * to Red Hat, Inc. under one or more contributor license agreements.
006     * See the AUTHORS.txt file in the distribution for a full listing of 
007     * individual contributors. 
008     *
009     * JBoss DNA is free software. Unless otherwise indicated, all code in JBoss DNA
010     * is licensed to you under the terms of the GNU Lesser General Public License as
011     * published by the Free Software Foundation; either version 2.1 of
012     * the License, or (at your option) any later version.
013     *
014     * JBoss DNA is distributed in the hope that it will be useful,
015     * but WITHOUT ANY WARRANTY; without even the implied warranty of
016     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017     * Lesser General Public License for more details.
018     *
019     * You should have received a copy of the GNU Lesser General Public
020     * License along with this software; if not, write to the Free
021     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
022     * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
023     */
024    package org.jboss.dna.common.jdbc.model.api;
025    
026    /**
027     * Provides all database table column specific metadata.
028     * 
029     * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
030     */
031    public interface TableColumn extends Column {
032    
033        /**
034         * Is this column the part of Best Row Identifier in any scope?
035         * 
036         * @return true if this column is the part of Best Row Identifier in any scope, otherwise return false (even if unknown)
037         */
038        Boolean isBestRowIdentifier();
039    
040        /**
041         * Is this column the part of Best Row Identifier in any scope?
042         * 
043         * @param bestRowIdentifier true if this column is the part of Best Row Identifier in any scope, otherwise return false (even
044         *        if unknown)
045         */
046        void setBestRowIdentifier( Boolean bestRowIdentifier );
047    
048        /**
049         * Return column's pseudo type
050         * 
051         * @return column's pseudo type
052         */
053        ColumnPseudoType getPseudoType();
054    
055        /**
056         * Sets column's pseudo type
057         * 
058         * @param pseudoType the column's pseudo type
059         */
060        void setPseudoType( ColumnPseudoType pseudoType );
061    
062        /**
063         * Returns column reference if datatype is REF
064         * 
065         * @return column reference if datatype is REF
066         */
067        Reference getReference();
068    
069        /**
070         * Sets column reference if datatype is REF
071         * 
072         * @param reference the column reference if datatype is REF
073         */
074        void setReference( Reference reference );
075    
076        /**
077         * Retrieves true if column is automatically updated when any value in a row is updated. If it retrieves true then column can
078         * be cast to VersionColumn.
079         * 
080         * @return true if column is automatically updated when any value in a row is updated, return false overwise.
081         */
082        Boolean isVersionColumn();
083    
084        /**
085         * Sets true if column is automatically updated when any value in a row is updated. If it retrieves true then column can be
086         * cast to VersionColumn.
087         * 
088         * @param versionColumn true if column is automatically updated when any value in a row is updated, return false overwise.
089         */
090        void setVersionColumn( Boolean versionColumn );
091    
092        /**
093         * Retrieves true if column is part of primary key.
094         * 
095         * @return true if column is part of primary key, return false overwise.
096         */
097        Boolean isPrimaryKeyColumn();
098    
099        /**
100         * Sets true if column is part of primary key.
101         * 
102         * @param primaryKeyColumn true if column is part of primary key, return false overwise.
103         */
104        void setPrimaryKeyColumn( Boolean primaryKeyColumn );
105    
106        /**
107         * Retrieves true if column is part of foreign key.
108         * 
109         * @return true if column is part of foreign key, return false overwise.
110         */
111        Boolean isForeignKeyColumn();
112    
113        /**
114         * Sets true if column is part of foreign key.
115         * 
116         * @param foreignKeyColumn true if column is part of foreign key, return false overwise.
117         */
118        void setForeignKeyColumn( Boolean foreignKeyColumn );
119    
120        /**
121         * Retrieves true if column is part of any index.
122         * 
123         * @return true if column is part of any index, return false overwise.
124         */
125        Boolean isIndexColumn();
126    
127        /**
128         * Sets true if column is part of any index.
129         * 
130         * @param indexColumn true if column is part of any index, return false overwise.
131         */
132        void setIndexColumn( Boolean indexColumn );
133    }