KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > sqls > Column


1 /*
2  * Copyright 2003, 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15
16  */

17 package org.apache.ws.jaxme.sqls;
18
19 import java.sql.Types JavaDoc;
20
21 import org.apache.ws.jaxme.sqls.impl.ColumnImpl;
22
23
24 /**
25  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
26  */

27 public interface Column {
28   public interface Name extends SQLFactory.Ident {
29   }
30
31   public interface Type {
32     /** <p>Returns the types name. The types name is human readable.</p>
33      */

34     public String JavaDoc getName();
35     /** <p>Returns the types JDBC type. The JDBC type is a constant,
36      * as specified by {@link java.sql.Types}.</p>
37      */

38     public int getJDBCType();
39
40     public static final Type BIGINT = new ColumnImpl.TypeImpl("BIGINT", Types.BIGINT);
41     public static final Type BINARY = new ColumnImpl.TypeImpl("BINARY", Types.BINARY);
42     public static final Type BIT = new ColumnImpl.TypeImpl("BIT", Types.BIT);
43     public static final Type CHAR = new ColumnImpl.TypeImpl("CHAR", Types.CHAR);
44     public static final Type DATE = new ColumnImpl.TypeImpl("DATE", Types.DATE);
45     public static final Type INTEGER = new ColumnImpl.TypeImpl("INTEGER", Types.INTEGER);
46     public static final Type FLOAT = new ColumnImpl.TypeImpl("FLOAT", Types.FLOAT);
47     public static final Type DOUBLE = new ColumnImpl.TypeImpl("DOUBLE", Types.DOUBLE);
48     public static final Type SMALLINT = new ColumnImpl.TypeImpl("SMALLINT", Types.SMALLINT);
49     public static final Type TIME = new ColumnImpl.TypeImpl("TIME", Types.TIME);
50     public static final Type TIMESTAMP = new ColumnImpl.TypeImpl("TIMESTAMP", Types.TIMESTAMP);
51     public static final Type TINYINT = new ColumnImpl.TypeImpl("TINYINT", Types.TINYINT);
52     public static final Type VARCHAR = new ColumnImpl.TypeImpl("VARCHAR", Types.VARCHAR);
53     public static final Type VARBINARY = new ColumnImpl.TypeImpl("VARBINARY", Types.VARBINARY);
54     public static final Type BLOB = new ColumnImpl.TypeImpl("CLOB", Types.BLOB);
55     public static final Type OTHER = new ColumnImpl.TypeImpl("OTHER", Types.OTHER);
56     public static final Type CLOB = new ColumnImpl.TypeImpl("CLOB", Types.CLOB);
57   }
58
59   /** <p>Returns the columns table.</p>
60    */

61   public Table getTable();
62
63   /** <p>Returns the columns name.</p>
64    */

65   public Name getName();
66
67   /** <p>Returns the columns fully qualified name, which is
68    * <code>getTable().getQName() + "." + getName()</code>.</p>
69    */

70   public String JavaDoc getQName();
71
72   /** <p>Returns the columns type.</p>
73    */

74   public Type getType();
75
76   /** <p>Returns whether this column is part of the primary key.</p>
77    */

78   public boolean isPrimaryKeyPart();
79
80   /** <p>Sets whether the column is nullable. By default columns are not
81    * nullable.</p>
82    */

83   public void setNullable(boolean pNullable);
84
85   /** <p>Returns whether the column is nullable. By default columns are not
86    * nullable.</p>
87    */

88   public boolean isNullable();
89
90   /** <p>Returns whether this Column may be casted to a {@link StringColumn}.</p>
91    */

92   public boolean isStringColumn();
93
94   /** <p>Returns whether this Column may be casted to a {@link BinaryColumn}.</p>
95    */

96   public boolean isBinaryColumn();
97
98   /** <p>Allows the user to attach application specific data to the column.</p>
99    */

100   public void setCustomData(Object JavaDoc pData);
101
102   /** <p>Allows the user to retrieve application specific data, which has
103    * previously been attached to the column.</p>
104    */

105   public Object JavaDoc getCustomData();
106
107   /** <p>Returns whether this column is a true column or a virtual column.</p>
108    */

109   public boolean isVirtual();
110 }
111
Popular Tags