Source Code Cross Referenced for Query.java in  » Search-Engine » Jofti » com » jofti » query » 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 » Search Engine » Jofti » com.jofti.query 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on 13-Jul-2005
003:         *
004:         */
005:        package com.jofti.query;
006:
007:        import com.jofti.api.IndexQuery;
008:        import com.jofti.core.QueryId;
009:        import com.jofti.core.QueryType;
010:
011:        /**
012:         * 
013:         *
014:         * Basic usage is "select ${classname} where ${propertyname} [=,<,>,!=,>=,<=] 'value'"
015:         * <p>
016:         * multiproperty queries are of the form<br>
017:         * "select ${classname} where ${propertyname} [=,<,>,!=,>=,<=] 'value' [and,or] ${propertyname} [=,<,>,!=,>=,<=] 'value'"
018:         * <p>
019:         * compound queries are supported as ${query} [and,or] ${query}
020:         * <p>
021:         * ordering for compound queries is achieved through use of bracket groups<br>
022:         * "select ${classname} where ($propertyname} [=,<,>,!=,>=,<=] 'value' [and,or] ${propertyname} [=,<,>,!=,>=,<=] 'value') [and,or] ${propertyname} [=,<,>,!=,>=,<=] 'value'"
023:         <p>
024:         * 
025:         * multiclass queries are of the form
026:         * <p>
027:         * select ${classname} as A, ${classname} as B where A.${propertyname} [=,<,>,!=,>=,<=] 'value' [and.or] B.${propertyname}  [=,<,>,!=,>=,<=] 'value'"
028:         * <p>
029:         * 
030:         * All values are created using a reflective String constructor .So if you want to Compare an Integer(22) you just specify
031:         * value=22  - the value type is chosen based on the declared type of the field.
032:         * <p>
033:         * For primitive wrappers in the JVM the propertyname is always the literal string 'VALUE' (case insensitive)
034:         * * 		<li>
035:         * 			java.lang.String.class,
036:         java.lang.Integer.class,
037:         java.lang.Double.class,
038:         java.lang.Float.class,
039:         java.lang.Long.class,
040:         java.lang.Short.class,
041:         java.math.BigInteger.class,
042:         java.math.BigDecimal.class,
043:         java.util.Date.class,
044:         java.net.URI.class 
045:         </li>  
046:         * <p>
047:         * For example to query an integer you would write
048:         * <p>
049:         * select java.lang.Integer where VALUE = 20
050:         * <p>
051:         * or <br>
052:         * select java.lang.Integer as i where i.VALUE =20
053:         * <p>
054:         * 
055:         * Dates are constructed using the default encoding of the JVM. So a UK encoding would be:
056:         * <p>
057:         * select java.util.Date where value <='4/10/1901 00:00:00' 
058:         * <p>
059:         * For user defined classes in order to query the property type must have a String constructor and must 
060:         * implement equals and hashCode correctly.
061:         *  <p>
062:         *  
063:         *  @author Steve Woodcock
064:         *  @version 1.0
065:         *  @deprecated  Use SQLQuery Object
066:         */
067:        public class Query implements  IndexQuery, QueryId {
068:
069:            int hashCode = 0;
070:            String query = null;
071:            static final QueryType QUERY_ID = QueryType.UNPARSED_QUERY;
072:
073:            private static final String TERMINATOR = ";";
074:
075:            /**
076:             * @param query
077:             */
078:            public Query(String query) {
079:                this .query = query + TERMINATOR;
080:            }
081:
082:            public String getQuery() {
083:                return this .query;
084:            }
085:
086:            public QueryType getQueryType() {
087:                return QUERY_ID;
088:            }
089:
090:            public int hashCode() {
091:                if (hashCode == 0) {
092:                    hashCode = query.hashCode();
093:                }
094:                return hashCode;
095:            }
096:
097:            public boolean equals(Object obj) {
098:                return query.equals(obj);
099:            }
100:
101:            public IndexQuery setParameter(String name, Object value) {
102:                throw new UnsupportedOperationException(
103:                        "Parameters are not supported for convenience classes");
104:            }
105:
106:            /* (non-Javadoc)
107:             * @see com.jofti.api.IndexQuery#setParameter(int, java.lang.Object)
108:             */
109:            public IndexQuery setParameter(int position, Object value) {
110:                throw new UnsupportedOperationException(
111:                        "Parameters are not supported for convenience classes");
112:
113:            }
114:
115:            public IndexQuery setFirstResult(int firstResult) {
116:                // TODO Auto-generated method stub
117:                return null;
118:            }
119:
120:            public IndexQuery setMaxResults(int maxResults) {
121:                // TODO Auto-generated method stub
122:                return null;
123:            }
124:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.