Source Code Cross Referenced for Variable.java in  » Database-ORM » openjpa » org » apache » openjpa » jdbc » kernel » exps » 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 » openjpa » org.apache.openjpa.jdbc.kernel.exps 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements.  See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership.  The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License.  You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied.  See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.    
018:         */
019:        package org.apache.openjpa.jdbc.kernel.exps;
020:
021:        import java.sql.SQLException;
022:
023:        import org.apache.openjpa.jdbc.sql.Result;
024:        import org.apache.openjpa.jdbc.sql.SQLBuffer;
025:        import org.apache.openjpa.jdbc.sql.Select;
026:        import org.apache.openjpa.kernel.exps.ExpressionVisitor;
027:        import org.apache.openjpa.meta.ClassMetaData;
028:
029:        /**
030:         * A variable in a filter. Typically, the {@link #initialize} and
031:         * {@link #getJoins} methods of this value are not called. They are
032:         * only called if the variable is bound but otherwise unused in the filter,
033:         * in which case we must at least make the joins to the variable because the
034:         * act of binding a variable should at least guarantee that an instance
035:         * represting the variable could exist (i.e. the binding collection is not
036:         * empty).
037:         *
038:         * @author Abe White
039:         */
040:        class Variable extends AbstractVal {
041:
042:            private final String _name;
043:            private final Class _type;
044:            private ClassMetaData _meta;
045:            private PCPath _path = null;
046:            private Class _cast = null;
047:
048:            /**
049:             * Constructor. Supply variable name and type.
050:             */
051:            public Variable(String name, Class type) {
052:                _name = name;
053:                _type = type;
054:            }
055:
056:            /**
057:             * Return the variable name.
058:             */
059:            public String getName() {
060:                return _name;
061:            }
062:
063:            /**
064:             * Return true if the variable is bound.
065:             */
066:            public boolean isBound() {
067:                return _path != null;
068:            }
069:
070:            /**
071:             * Return the path this variable is aliased to.
072:             */
073:            public PCPath getPCPath() {
074:                return _path;
075:            }
076:
077:            /**
078:             * Set the path this variable is aliased to.
079:             */
080:            public void setPCPath(PCPath path) {
081:                _path = path;
082:            }
083:
084:            public ClassMetaData getMetaData() {
085:                return _meta;
086:            }
087:
088:            public void setMetaData(ClassMetaData meta) {
089:                _meta = meta;
090:            }
091:
092:            public boolean isVariable() {
093:                return true;
094:            }
095:
096:            public Class getType() {
097:                if (_cast != null)
098:                    return _cast;
099:                return _type;
100:            }
101:
102:            public void setImplicitType(Class type) {
103:                _cast = type;
104:                if (_path != null)
105:                    _path.setImplicitType(type);
106:            }
107:
108:            public ExpState initialize(Select sel, ExpContext ctx, int flags) {
109:                if (_path != null) {
110:                    _path.addVariableAction(this );
111:                    return _path.initialize(sel, ctx, flags | JOIN_REL);
112:                }
113:                return ExpState.NULL;
114:            }
115:
116:            public void select(Select sel, ExpContext ctx, ExpState state,
117:                    boolean pks) {
118:            }
119:
120:            public void selectColumns(Select sel, ExpContext ctx,
121:                    ExpState state, boolean pks) {
122:            }
123:
124:            public void groupBy(Select sel, ExpContext ctx, ExpState state) {
125:            }
126:
127:            public void orderBy(Select sel, ExpContext ctx, ExpState state,
128:                    boolean asc) {
129:            }
130:
131:            public Object load(ExpContext ctx, ExpState state, Result res)
132:                    throws SQLException {
133:                return null;
134:            }
135:
136:            public void calculateValue(Select sel, ExpContext ctx,
137:                    ExpState state, Val other, ExpState otherState) {
138:                if (_path != null)
139:                    _path.calculateValue(sel, ctx, state, other, otherState);
140:            }
141:
142:            public int length(Select sel, ExpContext ctx, ExpState state) {
143:                return 0;
144:            }
145:
146:            public void appendTo(Select sel, ExpContext ctx, ExpState state,
147:                    SQLBuffer sql, int index) {
148:            }
149:
150:            public void appendIsEmpty(Select sel, ExpContext ctx,
151:                    ExpState state, SQLBuffer buf) {
152:            }
153:
154:            public void appendIsNotEmpty(Select sel, ExpContext ctx,
155:                    ExpState state, SQLBuffer buf) {
156:            }
157:
158:            public void appendSize(Select sel, ExpContext ctx, ExpState state,
159:                    SQLBuffer buf) {
160:            }
161:
162:            public void appendIsNull(Select sel, ExpContext ctx,
163:                    ExpState state, SQLBuffer buf) {
164:            }
165:
166:            public void appendIsNotNull(Select sel, ExpContext ctx,
167:                    ExpState state, SQLBuffer buf) {
168:            }
169:
170:            public void acceptVisit(ExpressionVisitor visitor) {
171:                visitor.enter(this);
172:                if (_path != null)
173:                    _path.acceptVisit(visitor);
174:                visitor.exit(this);
175:            }
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.