Source Code Cross Referenced for Join.java in  » Database-ORM » hibernate » org » hibernate » mapping » 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 ORM » hibernate » org.hibernate.mapping 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$Id: Join.java 10040 2006-06-22 19:51:43Z steve.ebersole@jboss.com $
002:        package org.hibernate.mapping;
003:
004:        import java.io.Serializable;
005:        import java.util.ArrayList;
006:        import java.util.Iterator;
007:
008:        import org.hibernate.sql.Alias;
009:        import org.hibernate.engine.ExecuteUpdateResultCheckStyle;
010:
011:        /**
012:         * @author Gavin King
013:         */
014:        public class Join implements  Serializable {
015:
016:            private static final Alias PK_ALIAS = new Alias(15, "PK");
017:
018:            private ArrayList properties = new ArrayList();
019:            private Table table;
020:            private KeyValue key;
021:            private PersistentClass persistentClass;
022:            private boolean sequentialSelect;
023:            private boolean inverse;
024:            private boolean optional;
025:
026:            // Custom SQL
027:            private String customSQLInsert;
028:            private boolean customInsertCallable;
029:            private ExecuteUpdateResultCheckStyle insertCheckStyle;
030:            private String customSQLUpdate;
031:            private boolean customUpdateCallable;
032:            private ExecuteUpdateResultCheckStyle updateCheckStyle;
033:            private String customSQLDelete;
034:            private boolean customDeleteCallable;
035:            private ExecuteUpdateResultCheckStyle deleteCheckStyle;
036:
037:            public void addProperty(Property prop) {
038:                properties.add(prop);
039:                prop.setPersistentClass(getPersistentClass());
040:            }
041:
042:            public boolean containsProperty(Property prop) {
043:                return properties.contains(prop);
044:            }
045:
046:            public Iterator getPropertyIterator() {
047:                return properties.iterator();
048:            }
049:
050:            public Table getTable() {
051:                return table;
052:            }
053:
054:            public void setTable(Table table) {
055:                this .table = table;
056:            }
057:
058:            public KeyValue getKey() {
059:                return key;
060:            }
061:
062:            public void setKey(KeyValue key) {
063:                this .key = key;
064:            }
065:
066:            public PersistentClass getPersistentClass() {
067:                return persistentClass;
068:            }
069:
070:            public void setPersistentClass(PersistentClass persistentClass) {
071:                this .persistentClass = persistentClass;
072:            }
073:
074:            public void createForeignKey() {
075:                getKey().createForeignKeyOfEntity(
076:                        persistentClass.getEntityName());
077:            }
078:
079:            public void createPrimaryKey() {
080:                //Primary key constraint
081:                PrimaryKey pk = new PrimaryKey();
082:                pk.setTable(table);
083:                pk.setName(PK_ALIAS.toAliasString(table.getName()));
084:                table.setPrimaryKey(pk);
085:
086:                pk.addColumns(getKey().getColumnIterator());
087:            }
088:
089:            public int getPropertySpan() {
090:                return properties.size();
091:            }
092:
093:            public void setCustomSQLInsert(String customSQLInsert,
094:                    boolean callable, ExecuteUpdateResultCheckStyle checkStyle) {
095:                this .customSQLInsert = customSQLInsert;
096:                this .customInsertCallable = callable;
097:                this .insertCheckStyle = checkStyle;
098:            }
099:
100:            public String getCustomSQLInsert() {
101:                return customSQLInsert;
102:            }
103:
104:            public boolean isCustomInsertCallable() {
105:                return customInsertCallable;
106:            }
107:
108:            public ExecuteUpdateResultCheckStyle getCustomSQLInsertCheckStyle() {
109:                return insertCheckStyle;
110:            }
111:
112:            public void setCustomSQLUpdate(String customSQLUpdate,
113:                    boolean callable, ExecuteUpdateResultCheckStyle checkStyle) {
114:                this .customSQLUpdate = customSQLUpdate;
115:                this .customUpdateCallable = callable;
116:                this .updateCheckStyle = checkStyle;
117:            }
118:
119:            public String getCustomSQLUpdate() {
120:                return customSQLUpdate;
121:            }
122:
123:            public boolean isCustomUpdateCallable() {
124:                return customUpdateCallable;
125:            }
126:
127:            public ExecuteUpdateResultCheckStyle getCustomSQLUpdateCheckStyle() {
128:                return updateCheckStyle;
129:            }
130:
131:            public void setCustomSQLDelete(String customSQLDelete,
132:                    boolean callable, ExecuteUpdateResultCheckStyle checkStyle) {
133:                this .customSQLDelete = customSQLDelete;
134:                this .customDeleteCallable = callable;
135:                this .deleteCheckStyle = checkStyle;
136:            }
137:
138:            public String getCustomSQLDelete() {
139:                return customSQLDelete;
140:            }
141:
142:            public boolean isCustomDeleteCallable() {
143:                return customDeleteCallable;
144:            }
145:
146:            public ExecuteUpdateResultCheckStyle getCustomSQLDeleteCheckStyle() {
147:                return deleteCheckStyle;
148:            }
149:
150:            public boolean isSequentialSelect() {
151:                return sequentialSelect;
152:            }
153:
154:            public void setSequentialSelect(boolean deferred) {
155:                this .sequentialSelect = deferred;
156:            }
157:
158:            public boolean isInverse() {
159:                return inverse;
160:            }
161:
162:            public void setInverse(boolean leftJoin) {
163:                this .inverse = leftJoin;
164:            }
165:
166:            public String toString() {
167:                return getClass().getName() + '(' + table.toString() + ')';
168:            }
169:
170:            public boolean isLazy() {
171:                Iterator iter = getPropertyIterator();
172:                while (iter.hasNext()) {
173:                    Property prop = (Property) iter.next();
174:                    if (!prop.isLazy())
175:                        return false;
176:                }
177:                return true;
178:            }
179:
180:            public boolean isOptional() {
181:                return optional;
182:            }
183:
184:            public void setOptional(boolean nullable) {
185:                this.optional = nullable;
186:            }
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.