Source Code Cross Referenced for ReadQueryTemplate.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » database » queries » 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 » Web Framework » rife 1.6.1 » com.uwyn.rife.database.queries 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
003:         * Distributed under the terms of either:
004:         * - the common development and distribution license (CDDL), v1.0; or
005:         * - the GNU Lesser General Public License, v2.1 or later
006:         * $Id: ReadQueryTemplate.java 3654 2007-02-06 06:50:16Z gbevin $
007:         */
008:        package com.uwyn.rife.database.queries;
009:
010:        import com.uwyn.rife.database.capabilities.Capabilities;
011:        import com.uwyn.rife.template.Template;
012:
013:        /**
014:         * An instance of <code>ReadQueryTemplate</code> will obtain a SQL from a
015:         * {@link Template} block. If the template is provided but no block name, 
016:         * the entire content of the template will be used as the SQL query.
017:         * 
018:         * <p>This allows you to write your custom SQL queries in dedicated templates,
019:         * to name them, and to use them together with the functionalities that are
020:         * provided by {@link com.uwyn.rife.database.DbQueryManager}
021:         *
022:         * @author Geert Bevin (gbevin[remove] at uwyn dot com)
023:         * @version $Revision: 3654 $
024:         * @since 1.6
025:         */
026:        public class ReadQueryTemplate implements  ReadQuery {
027:            private Template mTemplate = null;
028:            private String mBlock = null;
029:
030:            /**
031:             * Creates a new empty instance of <code>ReadQueryTemplate</code>.
032:             * @since 1.6
033:             */
034:            public ReadQueryTemplate() {
035:            }
036:
037:            /**
038:             * Creates a new instance of <code>ReadQueryTemplate</code> with the
039:             * template instance whose content provides the SQL query that will be
040:             * executed.
041:             *
042:             * @param template the template instance
043:             * @since 1.6
044:             */
045:            public ReadQueryTemplate(Template template) {
046:                setTemplate(template);
047:            }
048:
049:            /**
050:             * Creates a new instance of <code>ReadQueryTemplate</code> with the
051:             * template instance and block name that provide the SQL that will
052:             * be executed.
053:             *
054:             * @param template the template instance
055:             * @param block the name of the template block
056:             * @since 1.6
057:             */
058:            public ReadQueryTemplate(Template template, String block) {
059:                setTemplate(template);
060:                setBlock(block);
061:            }
062:
063:            /**
064:             * Sets the template instance.
065:             *
066:             * @param template the template instance
067:             * @return this <code>ReadQueryTemplate</code> instance.
068:             * @see #setTemplate
069:             * @see #getTemplate
070:             * @since 1.6
071:             */
072:            public ReadQueryTemplate template(Template template) {
073:                setTemplate(template);
074:                return this ;
075:            }
076:
077:            /**
078:             * Sets the template instance.
079:             *
080:             * @param template the template instance
081:             * @see #template
082:             * @see #getTemplate
083:             * @since 1.6
084:             */
085:            public void setTemplate(Template template) {
086:                mTemplate = template;
087:            }
088:
089:            /**
090:             * Retrieves the template instance.
091:             *
092:             * @return the template instance; or
093:             * <p><code>null</code> if no template instance was provided
094:             * @see #template
095:             * @see #setTemplate
096:             * @since 1.6
097:             */
098:            public Template getTemplate() {
099:                return mTemplate;
100:            }
101:
102:            /**
103:             * Sets the name of the template block.
104:             *
105:             * @param block the name of the template block
106:             * @return this <code>ReadQueryTemplate</code> instance.
107:             * @see #setBlock
108:             * @see #getBlock
109:             * @since 1.6
110:             */
111:            public ReadQueryTemplate block(String block) {
112:                setBlock(block);
113:                return this ;
114:            }
115:
116:            /**
117:             * Sets the name of the template block.
118:             *
119:             * @param block the name of the template block
120:             * @see #block
121:             * @see #getBlock
122:             * @since 1.6
123:             */
124:            public void setBlock(String block) {
125:                mBlock = block;
126:            }
127:
128:            /**
129:             * Retrieves the name of the template block.
130:             *
131:             * @return the name of the template block; or
132:             * <p><code>null</code> if no block name was provided
133:             * @see #block
134:             * @see #setBlock
135:             * @since 1.6
136:             */
137:            public String getBlock() {
138:                return mBlock;
139:            }
140:
141:            public void clear() {
142:                mTemplate = null;
143:                mBlock = null;
144:            }
145:
146:            public String getSql() {
147:                if (null == mTemplate) {
148:                    return null;
149:                }
150:
151:                if (null == mBlock) {
152:                    return mTemplate.getContent();
153:                }
154:
155:                return mTemplate.getBlock(mBlock);
156:            }
157:
158:            public QueryParameters getParameters() {
159:                return null;
160:            }
161:
162:            public Capabilities getCapabilities() {
163:                return null;
164:            }
165:
166:            public void setExcludeUnsupportedCapabilities(boolean flag) {
167:            }
168:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.