Source Code Cross Referenced for Column.java in  » Database-Client » Henplus » henplus » sqlmodel » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » Henplus » henplus.sqlmodel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This is free software, licensed under the Gnu Public License (GPL)
003:         * get a copy from <http://www.gnu.org/licenses/gpl.html>
004:         * @version $Id: Column.java,v 1.3 2004/03/07 14:22:02 hzeller Exp $ 
005:         * @author <a href="mailto:martin.grotzke@javakaffee.de">Martin Grotzke</a>
006:         */
007:        package henplus.sqlmodel;
008:
009:        /**
010:         * Represents the meta data for a telational table Column
011:         *
012:         * @author Martin Grotzke
013:         */
014:        public final class Column implements  Comparable {
015:            private String _name;
016:            private int _position; // starting at 1
017:            private String _type;
018:            private int _size;
019:            private boolean _nullable;
020:            private String _default;
021:            private ColumnPkInfo _pkInfo;
022:            private ColumnFkInfo _fkInfo;
023:
024:            public Column(String name) {
025:                _name = name;
026:            }
027:
028:            public String getName() {
029:                return _name;
030:            }
031:
032:            public void setName(String string) {
033:                _name = string;
034:            }
035:
036:            public String getDefault() {
037:                return _default;
038:            }
039:
040:            public String getType() {
041:                return _type;
042:            }
043:
044:            /**
045:             * Set the default value for this Column.
046:             * @param defaultValue
047:             */
048:            public void setDefault(String defaultValue) {
049:                _default = defaultValue;
050:            }
051:
052:            public void setType(String string) {
053:                _type = string;
054:            }
055:
056:            public int getSize() {
057:                return _size;
058:            }
059:
060:            public void setSize(int i) {
061:                _size = i;
062:            }
063:
064:            public boolean isNullable() {
065:                return _nullable;
066:            }
067:
068:            public void setNullable(boolean b) {
069:                _nullable = b;
070:            }
071:
072:            public int getPosition() {
073:                return _position;
074:            }
075:
076:            public void setPosition(int i) {
077:                _position = i;
078:            }
079:
080:            public boolean isPartOfPk() {
081:                return _pkInfo != null;
082:            }
083:
084:            public ColumnPkInfo getPkInfo() {
085:                return _pkInfo;
086:            }
087:
088:            public void setPkInfo(ColumnPkInfo pkInfo) {
089:                _pkInfo = pkInfo;
090:            }
091:
092:            public boolean isForeignKey() {
093:                return _fkInfo != null;
094:            }
095:
096:            public ColumnFkInfo getFkInfo() {
097:                return _fkInfo;
098:            }
099:
100:            public void setFkInfo(ColumnFkInfo info) {
101:                _fkInfo = info;
102:            }
103:
104:            /* 
105:             * Compares both <code>Column</code>s according to their position.
106:             * @see java.lang.Comparable#compareTo(java.lang.Object)
107:             */
108:            public int compareTo(Object o) {
109:                int result = 1;
110:                Column other = (Column) o;
111:                if (other.getPosition() < _position)
112:                    result = -1;
113:                else if (other.getPosition() == _position)
114:                    result = 0;
115:                return result;
116:            }
117:
118:            /**
119:             * 
120:             * @param o
121:             * @param colNameIgnoreCase  specifies if column names shall be compared in a case insensitive way.
122:             * @return if the columns are equal
123:             */
124:            public boolean equals(Object o, boolean colNameIgnoreCase) {
125:                if (o instanceof  Column) {
126:                    Column other = (Column) o;
127:
128:                    if (_size != other._size)
129:                        return false;
130:
131:                    // ignore the position, it's not important
132:                    /*
133:                    if (_position != other._position)
134:                        return false;
135:                     */
136:
137:                    if (_nullable != other._nullable)
138:                        return false;
139:
140:                    if ((_name == null && other._name != null)
141:                            || (_name != null && (colNameIgnoreCase
142:                                    && !_name.equalsIgnoreCase(other._name) || !colNameIgnoreCase
143:                                    && !_name.equals(other._name))))
144:                        return false;
145:
146:                    if ((_type == null && other._type != null)
147:                            || (_type != null && !_type.equals(other._type)))
148:                        return false;
149:
150:                    if ((_default == null && other._default != null)
151:                            || (_default != null && !_default
152:                                    .equals(other._default)))
153:                        return false;
154:
155:                    if ((_pkInfo == null && other._pkInfo != null)
156:                            || (_pkInfo != null && !_pkInfo
157:                                    .equals(other._pkInfo)))
158:                        return false;
159:
160:                    if ((_fkInfo == null && other._fkInfo != null)
161:                            || (_fkInfo != null && !_fkInfo
162:                                    .equals(other._fkInfo)))
163:                        return false;
164:
165:                }
166:                return true;
167:            }
168:
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.