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 RDBMS supported standatd SQL types info.
028     * 
029     * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
030     */
031    public interface SqlTypeInfo extends DatabaseNamedObject {
032    
033        /**
034         * Returns localized version of type name (may be null). Type name is returned by DatabaseNamedObject.getName () method.
035         * 
036         * @return localized version of type name (may be null)
037         */
038        String getLocalizedTypeName();
039    
040        /**
041         * Sets localized version of type name (may be null). Type name is returned by DatabaseNamedObject.getName () method.
042         * 
043         * @param localizedTypeName localized version of type name (may be null)
044         */
045        void setLocalizedTypeName( String localizedTypeName );
046    
047        /**
048         * Gets SQL type nullability
049         * 
050         * @return SQL type nullability
051         */
052        NullabilityType getNullabilityType();
053    
054        /**
055         * Sets SQL type nullability
056         * 
057         * @param nullabilityType SQL type nullability
058         */
059        void setNullabilityType( NullabilityType nullabilityType );
060    
061        /**
062         * Gets SQL type from java.sql.Types
063         * 
064         * @return SQL type from java.sql.Types
065         */
066        SqlType getSqlType();
067    
068        /**
069         * Sets SQL type from java.sql.Types
070         * 
071         * @param sqlType the SQL type from java.sql.Types
072         */
073        void setSqlType( SqlType sqlType );
074    
075        /**
076         * Gets precision (number of fractional digits/scale) if applicable otherwise 0.
077         * 
078         * @return precision if applicable otherwise 0
079         */
080        Long getPrecision();
081    
082        /**
083         * Sets precision (number of fractional digits/scale) if applicable otherwise 0.
084         * 
085         * @param precision precision if applicable otherwise 0
086         */
087        void setPrecision( Long precision );
088    
089        /**
090         * Returns true if sql type can be a money value, for instance
091         * 
092         * @return true if sql type can be a money value, for instance
093         */
094        Boolean isFixedPrecisionScale();
095    
096        /**
097         * Sets true if sql type can be a money value, for instance
098         * 
099         * @param fixedPrecisionScale true if sql type can be a money value, for instance
100         */
101        void setFixedPrecisionScale( Boolean fixedPrecisionScale );
102    
103        /**
104         * Returns sql type precision radix (usually 2 or 10)
105         * 
106         * @return sql type precision radix (usually 2 or 10)
107         */
108        Integer getNumberPrecisionRadix();
109    
110        /**
111         * sets sql type precision radix (usually 2 or 10)
112         * 
113         * @param numberPrecisionRadix the sql type precision radix (usually 2 or 10)
114         */
115        void setNumberPrecisionRadix( Integer numberPrecisionRadix );
116    
117        /**
118         * Returns minimum scale supported
119         * 
120         * @return minimum scale supported
121         */
122        Integer getMinScale();
123    
124        /**
125         * Sets minimum scale supported
126         * 
127         * @param minScale minimum scale supported
128         */
129        void setMinScale( Integer minScale );
130    
131        /**
132         * Returns maximum scale supported
133         * 
134         * @return maximum scale supported
135         */
136        Integer getMaxScale();
137    
138        /**
139         * Sets maximum scale supported
140         * 
141         * @param maxScale the maximum scale supported
142         */
143        void setMaxScale( Integer maxScale );
144    
145        /**
146         * Returns prefix used to quote a literal (may be null)
147         * 
148         * @return prefix used to quote a literal (may be null)
149         */
150        String getLiteralPrefix();
151    
152        /**
153         * Sets prefix used to quote a literal (may be null)
154         * 
155         * @param literalPrefix the prefix used to quote a literal (may be null)
156         */
157        void setLiteralPrefix( String literalPrefix );
158    
159        /**
160         * Returns suffix used to quote a literal (may be null)
161         * 
162         * @return suffix used to quote a literal (may be null)
163         */
164        String getLiteralSuffix();
165    
166        /**
167         * Sets suffix used to quote a literal (may be null)
168         * 
169         * @param literalSuffix the suffix used to quote a literal (may be null)
170         */
171        void setLiteralSuffix( String literalSuffix );
172    
173        /**
174         * Returns parameters used in creating the type (may be null)
175         * 
176         * @return parameters used in creating the type (may be null)
177         */
178        String getCreateParams();
179    
180        /**
181         * Sets parameters used in creating the type (may be null)
182         * 
183         * @param createParams the parameters used in creating the type (may be null)
184         */
185        void setCreateParams( String createParams );
186    
187        /**
188         * Is sql type case sensitive
189         * 
190         * @return true if sql type case sensitive
191         */
192        Boolean isCaseSensitive();
193    
194        /**
195         * Is sql type case sensitive
196         * 
197         * @param caseSensitive the true if sql type case sensitive
198         */
199        void setCaseSensitive( Boolean caseSensitive );
200    
201        /**
202         * Returns sql type searchability
203         * 
204         * @return sql type searchability
205         */
206        SearchabilityType getSearchabilityType();
207    
208        /**
209         * Sets sql type searchability
210         * 
211         * @param searchabilityType the sql type searchability
212         */
213        void setSearchabilityType( SearchabilityType searchabilityType );
214    
215        /**
216         * Returns true if sql type is unsigned
217         * 
218         * @return true if sql type is unsigned
219         */
220        Boolean isUnsigned();
221    
222        /**
223         * Sets true if sql type is unsigned
224         * 
225         * @param unsigned true if sql type is unsigned
226         */
227        void setUnsigned( Boolean unsigned );
228    
229        /**
230         * Returns true if sql type can be used for an auto-increment value.
231         * 
232         * @return true if sql type can be used for an auto-increment value.
233         */
234        Boolean isAutoIncrement();
235    
236        /**
237         * Sets true if sql type can be used for an auto-increment value.
238         * 
239         * @param autoIncrement true if sql type can be used for an auto-increment value.
240         */
241        void setAutoIncrement( Boolean autoIncrement );
242    }