Source Code Cross Referenced for ColumnReference.java in  » Database-Client » SQL-Workbench » workbench » db » report » 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 » SQL Workbench » workbench.db.report 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ColumnReference.java
003:         *
004:         * This file is part of SQL Workbench/J, http://www.sql-workbench.net
005:         *
006:         * Copyright 2002-2008, Thomas Kellerer
007:         * No part of this code maybe reused without the permission of the author
008:         *
009:         * To contact the author please send an email to: support@sql-workbench.net
010:         *
011:         */
012:        package workbench.db.report;
013:
014:        import workbench.util.StrBuffer;
015:        import workbench.util.NumberStringCache;
016:
017:        /**
018:         *
019:         * @author  support@sql-workbench.net
020:         */
021:        public class ColumnReference {
022:            public static final String TAG_REFERENCE = "references";
023:            public static final String TAG_CONSTRAINT_NAME = "constraint-name";
024:            public static final String TAG_UPDATE_RULE = "update-rule";
025:            public static final String TAG_DELETE_RULE = "delete-rule";
026:            public static final String TAG_DEFER_RULE = "deferrable";
027:
028:            private String fkName;
029:            private String foreignColumn;
030:            private ReportTable foreignTable;
031:            private String updateRule;
032:            private String deleteRule;
033:            private String deferRule;
034:            private TagWriter tagWriter = new TagWriter();
035:            private int updateRuleValue;
036:            private int deleteRuleValue;
037:            private int deferrableRuleValue;
038:
039:            public ColumnReference() {
040:            }
041:
042:            public void setNamespace(String namespace) {
043:                this .tagWriter.setNamespace(namespace);
044:            }
045:
046:            public void setUpdateRuleValue(int value) {
047:                this .updateRuleValue = value;
048:            }
049:
050:            public void setDeleteRuleValue(int value) {
051:                this .deleteRuleValue = value;
052:            }
053:
054:            public void setDeferrableRuleValue(int value) {
055:                this .deferrableRuleValue = value;
056:            }
057:
058:            public void setConstraintName(String name) {
059:                this .fkName = name;
060:            }
061:
062:            public void setForeignColumn(String col) {
063:                this .foreignColumn = col;
064:            }
065:
066:            public void setForeignTable(ReportTable tbl) {
067:                this .foreignTable = tbl;
068:            }
069:
070:            public void setUpdateRule(String rule) {
071:                this .updateRule = rule;
072:            }
073:
074:            public String getUpdateRule() {
075:                return this .updateRule;
076:            }
077:
078:            public void setDeleteRule(String rule) {
079:                this .deleteRule = rule;
080:            }
081:
082:            public String getDeleteRule() {
083:                return deleteRule;
084:            }
085:
086:            public void setDeferRule(String rule) {
087:                this .deferRule = rule;
088:            }
089:
090:            public ReportTable getForeignTable() {
091:                return this .foreignTable;
092:            }
093:
094:            public String getFkName() {
095:                return fkName;
096:            }
097:
098:            public String getForeignColumn() {
099:                return foreignColumn;
100:            }
101:
102:            public String toString() {
103:                return this .getFkName();
104:            }
105:
106:            public StrBuffer getXml(StrBuffer indent) {
107:                StrBuffer result = new StrBuffer(250);
108:                StrBuffer myindent = new StrBuffer(indent);
109:                myindent.append("  ");
110:                tagWriter.appendOpenTag(result, indent, TAG_REFERENCE);
111:                result.append('\n');
112:
113:                result.append(getInnerXml(myindent));
114:
115:                tagWriter.appendCloseTag(result, indent, TAG_REFERENCE);
116:
117:                return result;
118:            }
119:
120:            public StrBuffer getInnerXml(StrBuffer indent) {
121:                StrBuffer result = new StrBuffer(250);
122:                this .foreignTable.appendTableNameXml(result, indent);
123:                //tagWriter.appendTag(result, indent, ReportTable.TAG_TABLE_NAME, this.foreignTable);
124:                tagWriter.appendTag(result, indent,
125:                        ReportColumn.TAG_COLUMN_NAME, this .foreignColumn);
126:                tagWriter.appendTag(result, indent, TAG_CONSTRAINT_NAME,
127:                        this .fkName);
128:
129:                tagWriter.appendTag(result, indent, TAG_DELETE_RULE,
130:                        this .deleteRule, "jdbcValue", NumberStringCache
131:                                .getNumberString(this .deleteRuleValue));
132:                tagWriter.appendTag(result, indent, TAG_UPDATE_RULE,
133:                        this .updateRule, "jdbcValue", NumberStringCache
134:                                .getNumberString(this .updateRuleValue));
135:                tagWriter.appendTag(result, indent, TAG_DEFER_RULE,
136:                        this .deferRule, "jdbcValue", NumberStringCache
137:                                .getNumberString(this .deferrableRuleValue));
138:                return result;
139:            }
140:
141:            public boolean equals(Object o) {
142:                if (o == null)
143:                    return false;
144:                if (o instanceof  ColumnReference)
145:                    return equals((ColumnReference) o);
146:                return false;
147:            }
148:
149:            public boolean equals(ColumnReference ref) {
150:                try {
151:                    return (this .foreignColumn.equals(ref.foreignColumn)
152:                            && this .foreignTable.equals(ref.foreignTable)
153:                            && (this .updateRuleValue == ref.updateRuleValue)
154:                            && (this .deleteRuleValue == ref.deleteRuleValue) && (this .deferrableRuleValue == ref.deferrableRuleValue));
155:                } catch (Exception e) {
156:                    return false;
157:                }
158:            }
159:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.