Source Code Cross Referenced for EntityClause.java in  » ERP-CRM-Financial » SourceTap-CRM » org » ofbiz » entity » condition » 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 » ERP CRM Financial » SourceTap CRM » org.ofbiz.entity.condition 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: EntityClause.java,v 1.1 2003/08/17 04:56:25 jonesde Exp $
003:         *
004:         * <p>Copyright (c) 2001 The Open For Business Project - www.ofbiz.org
005:         *
006:         * <p>Permission is hereby granted, free of charge, to any person obtaining a
007:         *  copy of this software and associated documentation files (the "Software"),
008:         *  to deal in the Software without restriction, including without limitation
009:         *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
010:         *  and/or sell copies of the Software, and to permit persons to whom the
011:         *  Software is furnished to do so, subject to the following conditions:
012:         *
013:         * <p>The above copyright notice and this permission notice shall be included
014:         *  in all copies or substantial portions of the Software.
015:         *
016:         * <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
017:         *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
018:         *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
019:         *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
020:         *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
021:         *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
022:         *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
023:         */
024:
025:        package org.ofbiz.entity.condition;
026:
027:        import org.ofbiz.entity.GenericEntityException;
028:        import org.ofbiz.entity.model.ModelEntity;
029:        import org.ofbiz.entity.model.ModelReader;
030:
031:        /**
032:         * Generic Entity Clause - Used to string together entities to make a find clause
033:         *
034:         *@author     <a href='mailto:chris_maurer@altavista.com'>Chris Maurer</a>
035:         *@author     <a href="mailto:jonesde@ofbiz.org">David E. Jones</a>
036:         *@created    Mon Nov 5, 2001
037:         *@version    1.0
038:         */
039:        public class EntityClause {
040:
041:            private String firstEntity = "";
042:            private String secondEntity = "";
043:            private String firstField = "";
044:            private String secondField = "";
045:            private ModelEntity firstModelEntity = null;
046:            private ModelEntity secondModelEntity = null;
047:            private EntityOperator interFieldOperation = null;
048:            private EntityOperator intraFieldOperation = null;
049:
050:            private Object value = null;
051:
052:            public EntityClause() {
053:            }
054:
055:            public EntityClause(String firstEntity, String secondEntity,
056:                    String firstField, String secondField,
057:                    EntityOperator interFieldOperation,
058:                    EntityOperator intraFieldOperation) {
059:                this .firstEntity = firstEntity;
060:                this .secondEntity = secondEntity;
061:                this .firstField = firstField;
062:                this .secondField = secondField;
063:                this .interFieldOperation = interFieldOperation;
064:                this .intraFieldOperation = intraFieldOperation;
065:            }
066:
067:            public EntityClause(String firstEntity, String firstField,
068:                    Object value, EntityOperator interFieldOperation,
069:                    EntityOperator intraFieldOperation) {
070:                this .firstEntity = firstEntity;
071:                this .firstField = firstField;
072:                this .value = value;
073:                this .interFieldOperation = interFieldOperation;
074:                this .intraFieldOperation = intraFieldOperation;
075:            }
076:
077:            public String getFirstEntity() {
078:                return firstEntity;
079:            }
080:
081:            public String getSecondEntity() {
082:                return secondEntity;
083:            }
084:
085:            public String getFirstField() {
086:                return firstField;
087:            }
088:
089:            public String getSecondField() {
090:                return secondField;
091:            }
092:
093:            public Object getValue() {
094:                if (value == null)
095:                    value = new Object();
096:                return value;
097:            }
098:
099:            public EntityOperator getInterFieldOperation() {
100:                return interFieldOperation;
101:            }
102:
103:            public EntityOperator getIntraFieldOperation() {
104:                return intraFieldOperation;
105:            }
106:
107:            public void setFirstEntity(String firstEntity) {
108:                this .firstEntity = firstEntity;
109:            }
110:
111:            public void setSecondEntity(String secondEntity) {
112:                this .secondEntity = secondEntity;
113:            }
114:
115:            public void setFirstField(String firstField) {
116:                this .firstField = firstField;
117:            }
118:
119:            public void setSecondField(String secondField) {
120:                this .secondField = secondField;
121:            }
122:
123:            public void setInterFieldOperation(
124:                    EntityOperator interFieldOperation) {
125:                this .interFieldOperation = interFieldOperation;
126:            }
127:
128:            public void setIntraFieldOperation(
129:                    EntityOperator intraFieldOperation) {
130:                this .intraFieldOperation = intraFieldOperation;
131:            }
132:
133:            // --  Protected Methods  - for internal use only --//
134:            protected void setModelEntities(ModelReader modelReader)
135:                    throws GenericEntityException {
136:                firstModelEntity = (ModelEntity) modelReader
137:                        .getModelEntity(firstEntity);
138:                if (secondEntity != null && !secondEntity.equals("")) {
139:                    secondModelEntity = (ModelEntity) modelReader
140:                            .getModelEntity(secondEntity);
141:                }
142:            }
143:
144:            protected ModelEntity getFirstModelEntity() {
145:                return firstModelEntity;
146:            }
147:
148:            protected ModelEntity getSecondModelEntity() {
149:                return secondModelEntity;
150:            }
151:
152:            public String toString() {
153:                StringBuffer outputBuffer = new StringBuffer();
154:
155:                outputBuffer.append("[firstEntity,"
156:                        + (firstEntity == null ? "null" : firstEntity) + "]");
157:                outputBuffer.append("[secondEntity,"
158:                        + (secondEntity == null ? "null" : secondEntity) + "]");
159:                outputBuffer.append("[firstField,"
160:                        + (firstField == null ? "null" : firstField) + "]");
161:                outputBuffer.append("[secondField,"
162:                        + (secondField == null ? "null" : secondField) + "]");
163:                outputBuffer
164:                        .append("[firstModelEntity,"
165:                                + (firstModelEntity == null ? "null"
166:                                        : (firstModelEntity.getEntityName() == null ? "null"
167:                                                : firstModelEntity
168:                                                        .getEntityName()))
169:                                + "]");
170:                outputBuffer
171:                        .append("[secondModelEntity,"
172:                                + (secondModelEntity == null ? "null"
173:                                        : (secondModelEntity.getEntityName() == null ? "null"
174:                                                : secondModelEntity
175:                                                        .getEntityName()))
176:                                + "]");
177:                outputBuffer
178:                        .append("[interFieldOperation,"
179:                                + (interFieldOperation == null ? "null"
180:                                        : (interFieldOperation.getCode() == null ? "null"
181:                                                : interFieldOperation.getCode()))
182:                                + "]");
183:                outputBuffer
184:                        .append("[intraFieldOperation,"
185:                                + (intraFieldOperation == null ? "null"
186:                                        : (intraFieldOperation.getCode() == null ? "null"
187:                                                : intraFieldOperation.getCode()))
188:                                + "]");
189:                outputBuffer.append("[value,"
190:                        + (getValue().toString() == null ? "null" : getValue()
191:                                .toString()) + "]");
192:                return outputBuffer.toString();
193:            }
194:
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.