Java Doc for JDOQuery.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » query » jdo » 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 » Speedo_1.4.5 » org.objectweb.speedo.query.jdo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.objectweb.speedo.query.jdo.JDOQueryDefinitionImpl
      org.objectweb.speedo.query.jdo.JDOQuery

JDOQuery
public class JDOQuery extends JDOQueryDefinitionImpl implements Query(Code)
SpeedoQuery is the basic implementation of the javax.jdo.Query interface. This class is just a wrapper to a SpeedoCompiledQuery object which is a reused object.
author:
   S. Chassande-Barrioz


Field Summary
public  Mapextensions
    
 booleanmodifiable
    

Constructor Summary
public  JDOQuery()
    

Method Summary
public  voidaddExtension(String key, Object value)
    
public  voidclose(Object queryResult)
     Close a query result and release any resources associated with it.
public  voidcloseAll()
     Close all query results associated with this Query instance, and release all resources associated with them.
public  voidcompile()
     Verify the elements of the query and provide a hint to the query to prepare and optimize an execution plan.
public  voiddeclareImports(String imports)
     Set the import statements to be used to identify the fully qualified name of variables or parameters.
public  voiddeclareParameters(String parameters)
     Declare the list of parameters query execution. The parameter declaration is a String containing one or more query parameter declarations separated with commas.
public  voiddeclareVariables(String variables)
     Declare the unbound variables to be used in the query.
public  voiddefineWith(String query)
    
public  voiddefineWith(JDOQueryDefinitionImpl qd)
    
public  longdeletePersistentAll()
    
public  longdeletePersistentAll(Map params)
    
public  longdeletePersistentAll(Object[] params)
    
public  Objectexecute()
     Execute the query and return the filtered Set.
public  Objectexecute(Object p1)
     Execute the query and return the filtered Set.
public  Objectexecute(Object p1, Object p2)
     Execute the query and return the filtered Set.
public  Objectexecute(Object p1, Object p2, Object p3)
     Execute the query and return the filtered Set.
public  ObjectexecuteWithArray(Object[] anarray)
     Execute the query and return the filtered Set.

The execution of the query obtains the values of the parameters and matches them against the declared parameters in order.

public  ObjectexecuteWithMap(Map amap)
     Execute the query and return the filtered Set. The query is executed with the parameters set by the Map values.
public  FetchPlangetFetchPlan()
    
public  booleangetIgnoreCache()
     Get the ignoreCache option setting.
public  PersistenceManagergetPersistenceManager()
     Get the PersistenceManager associated with this Query.
public  CompiledQuerygetQueryCompiler()
    
public  QueryManagergetQueryManager()
    
public  booleanisUnmodifiable()
    
public  voidsetCandidates(Extent pcs)
     Set the candidate Extent to query.
public  voidsetCandidates(Collection pcs)
     Set the candidate Set to query.
public  voidsetClass(Class cls)
     Set the class of the candidate instances of the query.

The class specifies the class of the candidates of the query.

public  voidsetExtensions(Map exts)
    
public  voidsetFetchPlan(FetchPlan fp)
    
public  voidsetFilter(String f)
     Set the filter for the query.

The filter specification is a String containing a boolean expression that is to be evaluated for each of the instances in the candidate collection.

public  voidsetGrouping(String arg0)
    
public  voidsetIgnoreCache(boolean ignoreCache)
     Set the ignoreCache option.
public  voidsetIncludeSubClasses(boolean val)
    
public  voidsetLogger(Logger logger)
    
public  voidsetOrdering(String ordering)
     Set the ordering specification for the result Set.
public  voidsetPOManager(JDOPOManagerItf apm)
    
public  voidsetQueryCompiler(CompiledQuery aqc)
    
public  voidsetQueryManager(QueryManager aqm)
    
public  voidsetRange(long first, long last)
    
public  voidsetRange(String arg0)
    
public  voidsetResult(String _result)
    
public  voidsetResultClass(Class _resultClass)
    
public  voidsetUnique(boolean _unique)
    
public  voidsetUnmodifiable()
    

Field Detail
extensions
public Map extensions(Code)



modifiable
boolean modifiable(Code)




Constructor Detail
JDOQuery
public JDOQuery()(Code)




Method Detail
addExtension
public void addExtension(String key, Object value)(Code)



close
public void close(Object queryResult)(Code)
Close a query result and release any resources associated with it. The parameter is the return from execute(...) and might have iterators open on it. Iterators associated with the query result are invalidated: they return false to hasNext() and throw NoSuchElementException to next(). This method makes nothing, all is done by the SpeedoCompiledQuery object. This object is never closed, and could be reused in the future.
Parameters:
  queryResult - the result of execute(...) on this Query instance.



closeAll
public void closeAll()(Code)
Close all query results associated with this Query instance, and release all resources associated with them. The query results might have iterators open on them. Iterators associated with the query results are invalidated: they return false to hasNext() and throw NoSuchElementException to next().



compile
public void compile()(Code)
Verify the elements of the query and provide a hint to the query to prepare and optimize an execution plan.



declareImports
public void declareImports(String imports)(Code)
Set the import statements to be used to identify the fully qualified name of variables or parameters. Parameters and unbound variables might come from a different class from the candidate class, and the names need to be declared in an import statement to eliminate ambiguity. Import statements are specified as a String with semicolon-separated statements.

The String parameter to this method follows the syntax of the import statement of the Java language.
Parameters:
  imports - import statements separated by semicolons.




declareParameters
public void declareParameters(String parameters)(Code)
Declare the list of parameters query execution. The parameter declaration is a String containing one or more query parameter declarations separated with commas. Each parameter named in the parameter declaration must be bound to a value when the query is executed.

The String parameter to this method follows the syntax for formal parameters in the Java language.
Parameters:
  parameters - the list of parameters separated by commas.




declareVariables
public void declareVariables(String variables)(Code)
Declare the unbound variables to be used in the query. Variables might be used in the filter, and these variables must be declared with their type. The unbound variable declaration is a String containing one or more unbound variable declarations separated with semicolons. It follows the syntax for local variables in the Java language.
Parameters:
  variables - the variables separated by semicolons.



defineWith
public void defineWith(String query)(Code)



defineWith
public void defineWith(JDOQueryDefinitionImpl qd)(Code)



deletePersistentAll
public long deletePersistentAll()(Code)



deletePersistentAll
public long deletePersistentAll(Map params)(Code)



deletePersistentAll
public long deletePersistentAll(Object[] params)(Code)



execute
public Object execute()(Code)
Execute the query and return the filtered Set. the filtered Set.
See Also:   JDOQuery.executeWithArray(java.lang.Object[] parameters)



execute
public Object execute(Object p1)(Code)
Execute the query and return the filtered Set. the filtered Set.
See Also:   JDOQuery.executeWithArray(java.lang.Object[] parameters)
Parameters:
  p1 - the value of the first parameter declared.



execute
public Object execute(Object p1, Object p2)(Code)
Execute the query and return the filtered Set. the filtered Set.
See Also:   JDOQuery.executeWithArray(java.lang.Object[] parameters)
Parameters:
  p1 - the value of the first parameter declared.
Parameters:
  p2 - the value of the second parameter declared.



execute
public Object execute(Object p1, Object p2, Object p3)(Code)
Execute the query and return the filtered Set. the filtered Set.
See Also:   JDOQuery.executeWithArray(java.lang.Object[] parameters)
Parameters:
  p1 - the value of the first parameter declared.
Parameters:
  p2 - the value of the second parameter declared.
Parameters:
  p3 - the value of the third parameter declared.



executeWithArray
public Object executeWithArray(Object[] anarray)(Code)
Execute the query and return the filtered Set.

The execution of the query obtains the values of the parameters and matches them against the declared parameters in order. The names of the declared parameters are ignored. The type of the declared parameters must match the type of the passed parameters, except that the passed parameters might need to be unwrapped to get their primitive values.

The filter, import, declared parameters, declared variables, and ordering statements are verified for consistency.

Each element in the candidate Set is examined to see that it is assignment compatible to the Class of the query. It is then evaluated by the boolean expression of the filter. The element passes the filter if there exist unique values for all variables for which the filter expression evaluates to true. the filtered Set.
Parameters:
  anarray - the Object array with all of the parameters.




executeWithMap
public Object executeWithMap(Map amap)(Code)
Execute the query and return the filtered Set. The query is executed with the parameters set by the Map values. Each Map entry consists of a key which is the name of the parameter in the declareParameters method, and a value which is the value used in the execute method. The keys in the Map and the declared parameters must exactly match or a JDOUserException is thrown. the filtered Set.
See Also:   JDOQuery.executeWithArray(java.lang.Object[] parameters)
Parameters:
  amap - the Map containing all of the parameters.



getFetchPlan
public FetchPlan getFetchPlan()(Code)



getIgnoreCache
public boolean getIgnoreCache()(Code)
Get the ignoreCache option setting. the ignoreCache option setting.
See Also:   JDOQuery.setIgnoreCache



getPersistenceManager
public PersistenceManager getPersistenceManager()(Code)
Get the PersistenceManager associated with this Query.

If this Query was restored from a serialized form, it has no PersistenceManager, and this method returns null. the PersistenceManager associated with this Query.




getQueryCompiler
public CompiledQuery getQueryCompiler()(Code)



getQueryManager
public QueryManager getQueryManager()(Code)



isUnmodifiable
public boolean isUnmodifiable()(Code)



setCandidates
public void setCandidates(Extent pcs)(Code)
Set the candidate Extent to query.
Parameters:
  pcs - the Candidate Extent.



setCandidates
public void setCandidates(Collection pcs)(Code)
Set the candidate Set to query.
Parameters:
  pcs - the Candidate collection.



setClass
public void setClass(Class cls)(Code)
Set the class of the candidate instances of the query.

The class specifies the class of the candidates of the query. Elements of the candidate collection that are of the specified class are filtered before being put into the result Set.
Parameters:
  cls - the Class of the candidate instances.




setExtensions
public void setExtensions(Map exts)(Code)



setFetchPlan
public void setFetchPlan(FetchPlan fp)(Code)



setFilter
public void setFilter(String f)(Code)
Set the filter for the query.

The filter specification is a String containing a boolean expression that is to be evaluated for each of the instances in the candidate collection. If the filter is not specified, then it defaults to "true", which has the effect of filtering the input Set only for class type.

An element of the candidate collection is returned in the result if:

  • it is assignment compatible to the candidate Class of the Query; and
  • for all variables there exists a value for which the filter expression evaluates to true.

The user may denote uniqueness in the filter expression by explicitly declaring an expression (for example, e1 != e2).

Rules for constructing valid expressions follow the Java language, except for these differences:

  • Equality and ordering comparisons between primitives and instances of wrapper classes are valid.
  • Equality and ordering comparisons of Date fields and Date parameters are valid.
  • White space (non-printing characters space, tab, carriage return, and line feed) is a separator and is otherwise ignored.
  • The assignment operators =, +=, etc. and pre- and post-increment and -decrement are not supported. Therefore, there are no side effects from evaluation of any expressions.
  • Methods, including object construction, are not supported, except for Set.contains(Object o), Set.isEmpty(), String.startsWith (String s), and String.endsWith (String e). Implementations might choose to support non-mutating method calls as non-standard extensions.
  • Navigation through a null-valued field, which would throw NullPointerException, is treated as if the filter expression returned false for the evaluation of the current set of variable values. Other values for variables might still qualify the candidate instance for inclusion in the result set.
  • Navigation through multi-valued fields (Set types) is specified using a variable declaration and the Set.contains(Object o) method.

Identifiers in the expression are considered to be in the name space of the specified class, with the addition of declared imports, parameters and variables. As in the Java language, this is a reserved word which means the element of the collection being evaluated.

Navigation through single-valued fields is specified by the Java language syntax of field_name.field_name....field_name.

A JDO implementation is allowed to reorder the filter expression for optimization purposes.
Parameters:
  f - the query filter.




setGrouping
public void setGrouping(String arg0)(Code)



setIgnoreCache
public void setIgnoreCache(boolean ignoreCache)(Code)
Set the ignoreCache option. The default value for this option was set by the PersistenceManagerFactory or the PersistenceManager used to create this Query. The ignoreCache option setting specifies whether the query should execute entirely in the back end, instead of in the cache. If this flag is set to true, an implementation might be able to optimize the query execution by ignoring changed values in the cache. For optimistic transactions, this can dramatically improve query response times.
Parameters:
  ignoreCache - the setting of the ignoreCache option.



setIncludeSubClasses
public void setIncludeSubClasses(boolean val)(Code)



setLogger
public void setLogger(Logger logger)(Code)



setOrdering
public void setOrdering(String ordering)(Code)
Set the ordering specification for the result Set. The ordering specification is a String containing one or more ordering declarations separated by commas.

Each ordering declaration is the name of the field on which to order the results followed by one of the following words: "ascending" or "descending".

The field must be declared in the candidate class or must be a navigation expression starting with a field in the candidate class.

Valid field types are primitive types except boolean; wrapper types except Boolean; BigDecimal; BigInteger; String; and Date.
Parameters:
  ordering - the ordering specification.




setPOManager
public void setPOManager(JDOPOManagerItf apm)(Code)



setQueryCompiler
public void setQueryCompiler(CompiledQuery aqc)(Code)



setQueryManager
public void setQueryManager(QueryManager aqm)(Code)



setRange
public void setRange(long first, long last)(Code)



setRange
public void setRange(String arg0)(Code)



setResult
public void setResult(String _result)(Code)



setResultClass
public void setResultClass(Class _resultClass)(Code)



setUnique
public void setUnique(boolean _unique)(Code)



setUnmodifiable
public void setUnmodifiable()(Code)



Fields inherited from org.objectweb.speedo.query.jdo.JDOQueryDefinitionImpl
protected Class candidateClass(Code)(Java Doc)
protected Collection candidateInstances(Code)(Java Doc)
protected Extent extentClass(Code)(Java Doc)
protected boolean fetchIdentifierOnly(Code)(Java Doc)
protected String filter(Code)(Java Doc)
protected String grouping(Code)(Java Doc)
protected boolean ignoreCache(Code)(Java Doc)
protected List importStatements(Code)(Java Doc)
boolean includeSubClasses(Code)(Java Doc)
protected transient long indexFirst(Code)(Java Doc)
protected transient long indexLast(Code)(Java Doc)
protected List order(Code)(Java Doc)
protected String parameters(Code)(Java Doc)
protected String result(Code)(Java Doc)
protected Class resultClass(Code)(Java Doc)
protected short type(Code)(Java Doc)
protected boolean unique(Code)(Java Doc)
protected String variables(Code)(Java Doc)
protected boolean withPrefetch(Code)(Java Doc)

Methods inherited from org.objectweb.speedo.query.jdo.JDOQueryDefinitionImpl
public void defineWith(JDOQueryDefinitionImpl qd)(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public boolean fetchIdentifierOnly()(Code)(Java Doc)
public Class getCandidateClass()(Code)(Java Doc)
public Collection getCollection()(Code)(Java Doc)
public Extent getExtent()(Code)(Java Doc)
public String getFilter()(Code)(Java Doc)
public String getGrouping()(Code)(Java Doc)
public List getImportStatements()(Code)(Java Doc)
public boolean getIncludeSubClasses()(Code)(Java Doc)
public long getIndexFirst()(Code)(Java Doc)
public long getIndexLast()(Code)(Java Doc)
public List getOrder()(Code)(Java Doc)
public String getParameters()(Code)(Java Doc)
public short getQueryType()(Code)(Java Doc)
public String getResult()(Code)(Java Doc)
public Class getResultClass()(Code)(Java Doc)
public boolean getUnique()(Code)(Java Doc)
public String getVariables()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isCollection()(Code)(Java Doc)
public boolean isIgnoreCache()(Code)(Java Doc)
public String qdToString(boolean oneLine)(Code)(Java Doc)
public static String queryType2string(short type)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public boolean withPrefetch()(Code)(Java Doc)
public void withPrefetch(boolean withPrefetch)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.